aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/Diagnostic.td
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/Diagnostic.td')
-rw-r--r--include/clang/Basic/Diagnostic.td55
1 files changed, 34 insertions, 21 deletions
diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td
index 2616548bc009..48cbf09419b3 100644
--- a/include/clang/Basic/Diagnostic.td
+++ b/include/clang/Basic/Diagnostic.td
@@ -12,16 +12,20 @@
//
//===----------------------------------------------------------------------===//
-// Define the diagnostic mappings.
-class DiagMapping;
-def MAP_IGNORE : DiagMapping;
-def MAP_WARNING : DiagMapping;
-def MAP_ERROR : DiagMapping;
-def MAP_FATAL : DiagMapping;
+// Define the diagnostic severities.
+class Severity<string N> {
+ string Name = N;
+}
+def SEV_Ignored : Severity<"Ignored">;
+def SEV_Remark : Severity<"Remark">;
+def SEV_Warning : Severity<"Warning">;
+def SEV_Error : Severity<"Error">;
+def SEV_Fatal : Severity<"Fatal">;
// Define the diagnostic classes.
class DiagClass;
def CLASS_NOTE : DiagClass;
+def CLASS_REMARK : DiagClass;
def CLASS_WARNING : DiagClass;
def CLASS_EXTENSION : DiagClass;
def CLASS_ERROR : DiagClass;
@@ -57,7 +61,7 @@ include "DiagnosticGroups.td"
// All diagnostics emitted by the compiler are an indirect subclass of this.
-class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
+class Diagnostic<string text, DiagClass DC, Severity defaultmapping> {
/// Component is specified by the file with a big let directive.
string Component = ?;
string Text = text;
@@ -65,8 +69,8 @@ class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
SFINAEResponse SFINAE = SFINAE_Suppress;
bit AccessControl = 0;
bit WarningNoWerror = 0;
- bit WarningShowInSystemHeader = 0;
- DiagMapping DefaultMapping = defaultmapping;
+ bit ShowInSystemHeader = 0;
+ Severity DefaultSeverity = defaultmapping;
DiagGroup Group;
string CategoryName = "";
}
@@ -81,24 +85,33 @@ class AccessControl {
SFINAEResponse SFINAE = SFINAE_AccessControl;
}
+class ShowInSystemHeader {
+ bit ShowInSystemHeader = 1;
+}
+
+class SuppressInSystemHeader {
+ bit ShowInSystemHeader = 0;
+}
+
// FIXME: ExtWarn and Extension should also be SFINAEFailure by default.
-class Error<string str> : Diagnostic<str, CLASS_ERROR, MAP_ERROR>, SFINAEFailure;
-class Warning<string str> : Diagnostic<str, CLASS_WARNING, MAP_WARNING>;
-class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_IGNORE>;
-class ExtWarn<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
-class Note<string str> : Diagnostic<str, CLASS_NOTE, MAP_FATAL/*ignored*/>;
+class Error<string str> : Diagnostic<str, CLASS_ERROR, SEV_Error>, SFINAEFailure {
+ bit ShowInSystemHeader = 1;
+}
+class Warning<string str> : Diagnostic<str, CLASS_WARNING, SEV_Warning>;
+class Remark<string str> : Diagnostic<str, CLASS_REMARK, SEV_Ignored>;
+class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Ignored>;
+class ExtWarn<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Warning>;
+class Note<string str> : Diagnostic<str, CLASS_NOTE, SEV_Fatal/*ignored*/>;
-class DefaultIgnore { DiagMapping DefaultMapping = MAP_IGNORE; }
-class DefaultWarn { DiagMapping DefaultMapping = MAP_WARNING; }
-class DefaultError { DiagMapping DefaultMapping = MAP_ERROR; }
-class DefaultFatal { DiagMapping DefaultMapping = MAP_FATAL; }
+class DefaultIgnore { Severity DefaultSeverity = SEV_Ignored; }
+class DefaultWarn { Severity DefaultSeverity = SEV_Warning; }
+class DefaultError { Severity DefaultSeverity = SEV_Error; }
+class DefaultFatal { Severity DefaultSeverity = SEV_Fatal; }
class DefaultWarnNoWerror {
bit WarningNoWerror = 1;
}
-class DefaultWarnShowInSystemHeader {
- bit WarningShowInSystemHeader = 1;
-}
+class DefaultRemark { Severity DefaultSeverity = SEV_Remark; }
// Definitions for Diagnostics.
include "DiagnosticASTKinds.td"