def CLASS_EXTENSION : DiagClass;
def CLASS_ERROR : DiagClass;
+// Diagnostic Groups.
+class DiagGroup<string name>;
+class InGroup<DiagGroup Group> { DiagGroup Group = Group; }
+class IsGroup<string Name> { DiagGroup Group = DiagGroup<Name>; }
+
+def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
+def Trigraphs : DiagGroup<"trigraphs">;
-/*
-class Option<string name, list<OptionControlled> members> : OptionControlled {
- string Name = name;
- list<OptionControlled> Members = members;
-}
-// Definitions for options ("warning groups").
-include "DiagnosticOptions.td"
-*/
// All diagnostics emitted by the compiler are an indirect subclass of this.
class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
/// Component is specified by the file with a big let directive.
- string Component = ?;
- string Text = text;
- DiagClass Class = DC;
+ string Component = ?;
+ string Text = text;
+ DiagClass Class = DC;
DiagMapping DefaultMapping = defaultmapping;
+ DiagGroup Group;
}
class Error<string str> : Diagnostic<str, CLASS_ERROR, MAP_ERROR>;
"backslash and newline separated by space">;
// Trigraphs.
-def trigraph_ignored : Warning<"trigraph ignored">;
+def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>;
def trigraph_ignored_block_comment : Warning<
- "ignored trigraph would end block comment">;
-def trigraph_ends_block_comment : Warning<"trigraph ends block comment">;
-def trigraph_converted : Warning<"trigraph converted to '%0' character">;
+ "ignored trigraph would end block comment">, InGroup<Trigraphs>;
+def trigraph_ends_block_comment : Warning<"trigraph ends block comment">,
+ InGroup<Trigraphs>;
+def trigraph_converted : Warning<"trigraph converted to '%0' character">,
+ InGroup<Trigraphs>;
def ext_multi_line_bcpl_comment : Extension<"multi-line // comment">;
def ext_bcpl_comment : Extension<
def ext_pp_include_next_directive : Extension<
"#include_next is a language extension">;
def ext_pp_warning_directive : Extension<"#warning is a language extension">;
+
def ext_pp_extra_tokens_at_eol : ExtWarn<
- "extra tokens at end of #%0 directive">;
+ "extra tokens at end of #%0 directive">, IsGroup<"extra-tokens">;
+
def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
def ext_pp_bad_vaargs_use : Extension<
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
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">, DefaultIgnore;
+ "implicit declaration of function %0">,
+ InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
+def ext_implicit_function_decl : Extension<
+ "implicit declaration of function %0 is invalid in C99">,
+ InGroup<ImplicitFunctionDeclare>;
+
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">, DefaultIgnore;
+ "property attributes '%0' and '%1' are mutually exclusive">,
+ IsGroup<"readonly-setter-attrs">, DefaultIgnore;
// C++ declarations
def err_static_assert_expression_is_not_constant : Error<
"unexpected namespace name %0: expected expression">;
def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
def err_undeclared_use : Error<"use of undeclared '%0'">;
-def warn_deprecated : Warning<"%0 is deprecated">;
+def warn_deprecated : Warning<"%0 is deprecated">,
+ IsGroup<"deprecated-declarations">;
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">, DefaultIgnore;
+ "no previous prototype for function %0">,
+ IsGroup<"missing-prototypes">, DefaultIgnore;
def err_redefinition : Error<"redefinition of %0">;
def err_static_non_static : Error<
"static declaration of %0 follows non-static declaration">;
def err_goto_into_scope : Error<"illegal jump (scoping violation)">;
-def ext_implicit_function_decl : Extension<
- "implicit declaration of function %0 is invalid in C99">;
def err_func_returning_array_function : Error<
"function cannot return array or function type %0">;
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">, DefaultIgnore;
+ "comparing floating point with == or != is unsafe">,
+ IsGroup<"float-equal">, DefaultIgnore;
def err_typecheck_subscript_value : Error<
"subscripted value is neither array nor pointer">;
def err_value_init_for_array_type : Error<
"array types cannot be value-initialized">;
def warn_printf_not_string_constant : Warning<
- "format string is not a string literal (potentially insecure)">;
+ "format string is not a string literal (potentially insecure)">,
+ IsGroup<"format-nonliteral">;
def err_unexpected_interface : Error<
"unexpected interface name %0: expected expression">;
def ext_typecheck_convert_pointer_void_func : Extension<
"%2 %1 converts between void* and function pointer, expected %0">;
def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
- "pointer types point to integer types with different sign %2 %1, expected %0">;
+ "pointer types point to integer types with different sign %2 %1, expected %0">,
+ IsGroup<"pointer-sign">;
def ext_typecheck_convert_incompatible_pointer : ExtWarn<
"incompatible pointer types %2 %1, expected %0">;
def ext_typecheck_convert_discards_qualifiers : ExtWarn<