summaryrefslogtreecommitdiff
path: root/include/clang/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic')
-rw-r--r--include/clang/Basic/Diagnostic.td12
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td10
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td11
-rw-r--r--include/clang/Basic/Module.h12
-rw-r--r--include/clang/Basic/Sanitizers.def3
5 files changed, 40 insertions, 8 deletions
diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td
index 39da0060ddbd0..f25068eca1322 100644
--- a/include/clang/Basic/Diagnostic.td
+++ b/include/clang/Basic/Diagnostic.td
@@ -12,6 +12,8 @@
//
//===----------------------------------------------------------------------===//
+// See the Internals Manual, section The Diagnostics Subsystem for an overview.
+
// Define the diagnostic severities.
class Severity<string N> {
string Name = N;
@@ -100,10 +102,20 @@ class SuppressInSystemHeader {
class Error<string str> : Diagnostic<str, CLASS_ERROR, SEV_Error>, SFINAEFailure {
bit ShowInSystemHeader = 1;
}
+// Warnings default to on (but can be default-off'd with DefaultIgnore).
+// This is used for warnings about questionable code; warnings about
+// accepted language extensions should use Extension or ExtWarn below instead.
class Warning<string str> : Diagnostic<str, CLASS_WARNING, SEV_Warning>;
+// Remarks can be turned on with -R flags and provide commentary, e.g. on
+// optimizer decisions.
class Remark<string str> : Diagnostic<str, CLASS_REMARK, SEV_Ignored>;
+// Extensions are warnings about accepted language extensions.
+// Extension warnings are default-off but enabled by -pedantic.
class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Ignored>;
+// ExtWarns are warnings about accepted language extensions.
+// ExtWarn warnings are default-on.
class ExtWarn<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Warning>;
+// Notes can provide supplementary information on errors, warnings, and remarks.
class Note<string str> : Diagnostic<str, CLASS_NOTE, SEV_Fatal/*ignored*/>;
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index d95e43c10c558..f04ed8ed4ce6e 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -1114,14 +1114,12 @@ def err_pragma_cannot_end_force_cuda_host_device : Error<
} // end of Parse Issue category.
let CategoryName = "Modules Issue" in {
-def err_expected_module_interface_decl : Error<
- "expected module declaration at start of module interface">;
def err_unexpected_module_decl : Error<
- "module declaration must be the first declaration in the translation unit">;
+ "module declaration can only appear at the top level">;
def err_module_expected_ident : Error<
- "expected a module name after module%select{| import}0">;
-def err_unexpected_module_kind : Error<
- "unexpected module kind %0; expected 'implementation' or 'partition'">;
+ "expected a module name after '%select{module|import}0'">;
+def err_module_implementation_partition : Error<
+ "module partition must be declared 'export'">;
def err_attribute_not_module_attr : Error<
"%0 attribute cannot be applied to a module">;
def err_attribute_not_import_attr : Error<
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 6cb872cc27c52..b5fed1f218b68 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -8801,9 +8801,11 @@ def err_invalid_type_for_program_scope_var : Error<
}
let CategoryName = "Modules Issue" in {
+def err_module_decl_in_module_map_module : Error<
+ "'module' declaration found while building module from module map">;
def err_module_interface_implementation_mismatch : Error<
- "%select{'module'|'module partition'|'module implementation'}0 declaration "
- "found while %select{not |not |}0building module interface">;
+ "missing 'export' specifier in module declaration while "
+ "building module interface">;
def err_current_module_name_mismatch : Error<
"module name '%0' specified on command line does not match name of module">;
def err_module_redefinition : Error<
@@ -8846,8 +8848,13 @@ def err_module_self_import : Error<
"import of module '%0' appears within same top-level module '%1'">;
def err_module_import_in_implementation : Error<
"@import of module '%0' in implementation of '%1'; use #import">;
+
+// C++ Modules TS
def err_export_within_export : Error<
"export declaration appears within another export declaration">;
+def err_export_not_in_module_interface : Error<
+ "export declaration can only be used within a module interface unit after "
+ "the module declaration">;
def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
"ambiguous use of internal linkage declaration %0 defined in multiple modules">,
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index 8fcb0e8b056a9..28aa7db52992a 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -62,6 +62,18 @@ public:
/// \brief The location of the module definition.
SourceLocation DefinitionLoc;
+ enum ModuleKind {
+ /// \brief This is a module that was defined by a module map and built out
+ /// of header files.
+ ModuleMapModule,
+
+ /// \brief This is a C++ Modules TS module interface unit.
+ ModuleInterfaceUnit
+ };
+
+ /// \brief The kind of this module.
+ ModuleKind Kind = ModuleMapModule;
+
/// \brief The parent of this module. This will be NULL for the top-level
/// module.
Module *Parent;
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def
index c574045e139a4..f20d326e08f84 100644
--- a/include/clang/Basic/Sanitizers.def
+++ b/include/clang/Basic/Sanitizers.def
@@ -47,6 +47,9 @@ SANITIZER("kernel-address", KernelAddress)
// MemorySanitizer
SANITIZER("memory", Memory)
+// libFuzzer
+SANITIZER("fuzzer", Fuzzer)
+
// ThreadSanitizer
SANITIZER("thread", Thread)