]> granicus.if.org Git - clang/commitdiff
now that we've decoupled diagnostic classes from default mappings,
authorChris Lattner <sabre@nondot.org>
Wed, 15 Apr 2009 17:20:11 +0000 (17:20 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Apr 2009 17:20:11 +0000 (17:20 +0000)
move the remaining default mapping exceptions from C++ code into
the .td files.

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

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

index 97cce5938717374837adf44f70c0d2348da69fbe..12096347c8553ad34c14e19b883348f9b6ee45f8 100644 (file)
@@ -53,6 +53,12 @@ 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 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"
index 5090f7bcdbfaf620bb2eba7bcd3645c22a1ee57d..08c5b449987a437982bdf38d171bd50d44bd56e1 100644 (file)
@@ -52,10 +52,12 @@ def note_invalid_subexpr_in_ice : Note<
   "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;
 
 }
index 12df86771553382095fae66267dd89025686138b..b13f8435196183896060618c05ed59aafad8d4b6 100644 (file)
@@ -137,7 +137,7 @@ def ext_pp_counter : Extension<
 
 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>">;
index 7bef91c57a863a27168bb854485082c60f12b5ce..dd2ea2171bfa76b631b3456d9c92d33d31592753 100644 (file)
@@ -77,7 +77,7 @@ def err_parameter_name_omitted : Error<"parameter name omitted">;
 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 @@ def error_duplicate_ivar_use : Error<
   "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 @@ def err_template_spec_redecl_global_scope : Error<
 
 // 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_deprecated : Warning<"%0 is deprecated">;
 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 err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
 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">;
index f2722923010b93ac41f457ac8fd13a84fab8eff4..ca540a39983c2a5a1202f787becaabc526669479 100644 (file)
@@ -102,25 +102,8 @@ static bool WarningOptionCompare(const WarningOption &LHS,
 
 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