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"
"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;
}
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>">;
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">;
"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<
// 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">;
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">;
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">;
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