]> granicus.if.org Git - clang/commitdiff
Refactor 'Warning', 'Extension', and 'ExtWarn' TableGen classes to subclass
authorTed Kremenek <kremenek@apple.com>
Wed, 18 Mar 2009 16:00:17 +0000 (16:00 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 18 Mar 2009 16:00:17 +0000 (16:00 +0000)
'DiagnosticControlled'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67209 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Diagnostic.td

index 415e7fa811e5b3174f1159ba069633048f2c9271..dd8a872183b91d38aee7b951f5beb1ae9a80932d 100644 (file)
@@ -24,17 +24,13 @@ class Note<string text> : Diagnostic<text>;
 // Anything that can be controlled by an option subclasses this.
 class OptionControlled;
 
-class Warning<string text> : Diagnostic<text>, OptionControlled {
-  string DefaultMapping = "warning";
+class DiagnosticControlled<string text, string defaultMapping>
+  : Diagnostic<text>, OptionControlled {
+  string DefaultMapping = defaultMapping;
 }
-class Extension<string text> : Diagnostic<text>, OptionControlled {
-  string DefaultMapping = "ignore";
-}
-class ExtWarn<string text> : Diagnostic<text>, OptionControlled {
-  string DefaultMapping = "warning";
-}
-
-
+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;