[cfe-commits] r69183 - in /cfe/trunk: include/clang/Basic/Diagnostic.td include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticLexKinds.td include/clang/Basic/DiagnosticSemaKinds.td tools/clang-cc/Warnings.cpp

Chris Lattner sabre at nondot.org
Wed Apr 15 10:20:12 PDT 2009


Author: lattner
Date: Wed Apr 15 12:20:11 2009
New Revision: 69183

URL: http://llvm.org/viewvc/llvm-project?rev=69183&view=rev
Log:
now that we've decoupled diagnostic classes from default mappings,
move the remaining default mapping exceptions from C++ code into
the .td files.

Modified:
    cfe/trunk/include/clang/Basic/Diagnostic.td
    cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/tools/clang-cc/Warnings.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.td (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.td Wed Apr 15 12:20:11 2009
@@ -53,6 +53,12 @@
 class ExtWarn<string str>   : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
 class Note<string str>      : Diagnostic<str, CLASS_NOTE, MAP_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; }
+
 // Definitions for Diagnostics.
 include "DiagnosticASTKinds.td"
 include "DiagnosticAnalysisKinds.td"

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Wed Apr 15 12:20:11 2009
@@ -52,10 +52,12 @@
   "subexpression not valid in an integer constant expression">;
 
 // Driver
-def pp_macro_not_used : Warning<"macro is not used">;
+def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore;
+
+
 def err_pp_I_dash_not_supported : Error<
   "-I- not supported, please use -iquote instead">;
 def warn_pp_undef_identifier : Warning<
-  "%0 is not defined, evaluates to 0">;
+  "%0 is not defined, evaluates to 0">, DefaultIgnore;
 
 }

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Wed Apr 15 12:20:11 2009
@@ -137,7 +137,7 @@
 
 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
 def err_pp_hash_error : Error<"#error%0">;
-def err_pp_file_not_found : Error<"'%0' file not found">;
+def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
 def err_pp_empty_filename : Error<"empty filename">;
 def err_pp_include_too_deep : Error<"#include nested too deeply">;
 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Apr 15 12:20:11 2009
@@ -77,7 +77,7 @@
 def warn_decl_in_param_list : Warning<
   "declaration of %0 will not be visible outside of this function">;
 def warn_implicit_function_decl : Warning<
-  "implicit declaration of function %0">;
+  "implicit declaration of function %0">, DefaultIgnore;
 def err_ellipsis_first_arg : Error<
   "ISO C requires a named argument before '...'">;
 def err_declarator_need_ident : Error<"declarator requires an identifier">;
@@ -221,7 +221,7 @@
   "synthesized properties %0 and %1 both claim ivar %2">;
 def error_property_implemented : Error<"property %0 is already implemented">;
 def warn_objc_property_attr_mutually_exclusive : Warning<
-  "property attributes '%0' and '%1' are mutually exclusive">;
+  "property attributes '%0' and '%1' are mutually exclusive">, DefaultIgnore;
 
 // C++ declarations
 def err_static_assert_expression_is_not_constant : Error<
@@ -679,7 +679,7 @@
 
 // C++ Template Instantiation
 def err_template_recursion_depth_exceeded : Error<
-  "recursive template instantiation exceeded maximum depth of %0">;
+  "recursive template instantiation exceeded maximum depth of %0">,DefaultFatal;
 def note_template_recursion_depth : Note<
   "use -ftemplate-depth-N to increase recursive template instantiation depth">;
 
@@ -722,7 +722,8 @@
 def warn_unavailable : Warning<"%0 is unavailable">;
 def note_unavailable_here : Note<
   "function has been explicitly marked %select{unavailable|deleted}0 here">;
-def warn_missing_prototype : Warning<"no previous prototype for function %0">;
+def warn_missing_prototype : Warning<
+  "no previous prototype for function %0">, DefaultIgnore;
 def err_redefinition : Error<"redefinition of %0">;
 def err_static_non_static : Error<
   "static declaration of %0 follows non-static declaration">;
@@ -882,7 +883,7 @@
 def ext_offsetof_extended_field_designator : Extension<
   "using extended field designator is an extension">;
 def warn_floatingpoint_eq : Warning<
-  "comparing floating point with == or != is unsafe">;
+  "comparing floating point with == or != is unsafe">, DefaultIgnore;
 
 def err_typecheck_subscript_value : Error<
   "subscripted value is neither array nor pointer">;

Modified: cfe/trunk/tools/clang-cc/Warnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Warnings.cpp?rev=69183&r1=69182&r2=69183&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/Warnings.cpp (original)
+++ cfe/trunk/tools/clang-cc/Warnings.cpp Wed Apr 15 12:20:11 2009
@@ -102,25 +102,8 @@
 
 bool clang::ProcessWarningOptions(Diagnostic &Diags) {
   Diags.setSuppressSystemWarnings(true);  // Default to -Wno-system-headers
-  
-  // FIXME: These should be mapped to group options.
   Diags.setIgnoreAllWarnings(OptNoWarnings);
 
-  // Set some defaults that are currently set manually. This, too, should
-  // be in the tablegen stuff later.
-  Diags.setDiagnosticMapping(diag::pp_macro_not_used, diag::MAP_IGNORE);
-  Diags.setDiagnosticMapping(diag::warn_floatingpoint_eq, diag::MAP_IGNORE);
-  Diags.setDiagnosticMapping(diag::warn_objc_property_attr_mutually_exclusive,
-                             diag::MAP_IGNORE);
-  Diags.setDiagnosticMapping(diag::warn_pp_undef_identifier, diag::MAP_IGNORE);
-  Diags.setDiagnosticMapping(diag::warn_implicit_function_decl,
-                             diag::MAP_IGNORE);
-
-  Diags.setDiagnosticMapping(diag::err_pp_file_not_found, diag::MAP_FATAL);
-  Diags.setDiagnosticMapping(diag::err_template_recursion_depth_exceeded, 
-                             diag::MAP_FATAL);
-  Diags.setDiagnosticMapping(diag::warn_missing_prototype, diag::MAP_IGNORE);
-  
   // FIXME: -fdiagnostics-show-option
   // FIXME: -Wfatal-errors / -Wfatal-errors=foo
 





More information about the cfe-commits mailing list