[cfe-commits] r69149 - /cfe/trunk/include/clang/Basic/Diagnostic.td

Chris Lattner sabre at nondot.org
Tue Apr 14 22:15:08 PDT 2009


Author: lattner
Date: Wed Apr 15 00:15:08 2009
New Revision: 69149

URL: http://llvm.org/viewvc/llvm-project?rev=69149&view=rev
Log:
make default diagnostic mapping more explicit in .td file.

Modified:
    cfe/trunk/include/clang/Basic/Diagnostic.td

Modified: cfe/trunk/include/clang/Basic/Diagnostic.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.td?rev=69149&r1=69148&r2=69149&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.td (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.td Wed Apr 15 00:15:08 2009
@@ -12,30 +12,37 @@
 //
 //===----------------------------------------------------------------------===//
 
-// All diagnostics emitted by the compiler are an indirect subclass of this.
-class Diagnostic<string text> {
-  string Component = ?;
-  string Text = text;
+// Define the diagnostic mappings.
+class DiagMapping;
+def MAP_IGNORE  : DiagMapping;
+def MAP_WARNING : DiagMapping;
+def MAP_ERROR   : DiagMapping;
+def MAP_FATAL   : DiagMapping;
+
+/*
+class Option<string name, list<OptionControlled> members> : OptionControlled {
+  string Name = name;
+  list<OptionControlled> Members = members;
 }
 
-class Error<string text> : Diagnostic<text>;
-class Note<string text> : Diagnostic<text>;
+// Definitions for options ("warning groups").
+include "DiagnosticOptions.td"
 
-// Anything that can be controlled by an option subclasses this.
-class OptionControlled;
+*/
 
-class DiagnosticControlled<string text, string defaultMapping>
-  : Diagnostic<text>, OptionControlled {
-  string DefaultMapping = defaultMapping;
+// All diagnostics emitted by the compiler are an indirect subclass of this.
+class Diagnostic<string text, DiagMapping defaultmapping> {
+  /// Component is specified by the file with a big let directive.
+  string Component = ?;
+  string Text = text;
+  DiagMapping DefaultMapping = defaultmapping;
 }
-class Warning<string text> : DiagnosticControlled<text, "warning"> {}
-class Extension<string text> : DiagnosticControlled<text, "ignore"> {}
-class ExtWarn<string text> : DiagnosticControlled<text, "warning"> {}
 
-class Option<string name, list<OptionControlled> members> : OptionControlled {
-  string Name = name;
-  list<OptionControlled> Members = members;
-}
+class Error<string text>     : Diagnostic<text, MAP_ERROR>;
+class Warning<string text>   : Diagnostic<text, MAP_WARNING>;
+class Extension<string text> : Diagnostic<text, MAP_IGNORE>;
+class ExtWarn<string text>   : Diagnostic<text, MAP_WARNING>;
+class Note<string text>      : Diagnostic<text, MAP_FATAL /*ignored*/>;
 
 // Definitions for Diagnostics.
 include "DiagnosticASTKinds.td"
@@ -47,5 +54,3 @@
 include "DiagnosticParseKinds.td"
 include "DiagnosticSemaKinds.td"
 
-// Definitions for options ("warning groups").
-include "DiagnosticOptions.td"





More information about the cfe-commits mailing list