push categories forward a bit more: document them, add some

major buckets to catch parser and sema issues, add inline asm
category, and make diag groups take precedence over the 
sweeping categories just added.

llvm-svn: 104561
This commit is contained in:
Chris Lattner 2010-05-24 21:35:18 +00:00
parent 1b79babdec
commit b997626120
6 changed files with 77 additions and 43 deletions

View File

@ -36,6 +36,7 @@ td {
<ul>
<li><a href="#diagnostics_display">Controlling How Clang Displays Diagnostics</a></li>
<li><a href="#diagnostics_mappings">Diagnostic Mappings</a></li>
<li><a href="#diagnostics_categories">Diagnostic Categories</a><li>
<li><a href="#diagnostics_commandline">Controlling Diagnostics via Command Line Flags</a></li>
<li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li>
</ul>
@ -417,9 +418,9 @@ it:</p>
<li>An option that indicates how to control the diagnostic (for diagnostics that
support it) [<a
href="#opt_fdiagnostics-show-option">-fdiagnostics-show-option</a>].</li>
<li>A high-level category for the diagnostic for clients that want to group
diagnostics by class (for diagnostics that
support it) [<a
<li>A <a href="#diagnostics_categories">high-level category</a> for the
diagnostic for clients that want to group diagnostics by class (for
diagnostics that support it) [<a
href="#opt_fdiagnostics-show-category">-fdiagnostics-show-category</a>].</li>
<li>The line of source code that the issue occurs on, along with a caret and
ranges that indicate the important locations [<a
@ -435,6 +436,7 @@ it:</p>
<p>For more information please see <a href="#cl_diag_formatting">Formatting of
Diagnostics</a>.</p>
<h4 id="diagnostics_mappings">Diagnostic Mappings</h4>
<p>All diagnostics are mapped into one of these 5 classes:</p>
@ -448,7 +450,23 @@ Diagnostics</a>.</p>
<li>Fatal</li>
</ul></p>
<h4 id="diagnostics_commandline">Controlling Diagnostics via Command Line Flags</h4>
<h4 id="diagnostics_categories">Diagnostic Categories</h4>
<p>Though not shown by default, diagnostics may each be associated with a
high-level category. This category is intended to make it possible to triage
builds that produce a large number of errors or warnings in a grouped way.
</p>
<p>Categories are not shown by default, but they can be turned on with the
<a href="#opt_fdiagnostics-show-category">-fdiagnostics-show-category</a> option.
When set to "<tt>name</tt>", the category is printed textually in the diagnostic
output. When it is set to "<tt>id</tt>", a category number is printed. The
mapping of category names to category id's can be obtained by running '<tt>clang
--print-diagnostic-categories</tt>'.
</p>
<h4 id="diagnostics_commandline">Controlling Diagnostics via Command Line
Flags</h4>
<p>-W flags, -pedantic, etc</p>

View File

@ -42,7 +42,10 @@ class InGroup<DiagGroup G> { DiagGroup Group = G; }
//class IsGroup<string Name> { DiagGroup Group = DiagGroup<Name>; }
// This defines the diagnostic groups that have references to them.
// This defines all of the named diagnostic categories.
include "DiagnosticCategories.td"
// This defines all of the named diagnostic groups.
include "DiagnosticGroups.td"

View File

@ -14,17 +14,20 @@ let Component = "AST" in {
def note_expr_divide_by_zero : Note<"division by zero">;
// inline asm related.
def err_asm_invalid_escape : Error<
let CategoryName = "Inline Assembly Issue" in {
def err_asm_invalid_escape : Error<
"invalid %% escape in inline assembly string">;
def err_asm_unknown_symbolic_operand_name : Error<
def err_asm_unknown_symbolic_operand_name : Error<
"unknown symbolic operand name in inline assembly string">;
def err_asm_unterminated_symbolic_operand_name : Error<
def err_asm_unterminated_symbolic_operand_name : Error<
"unterminated symbolic operand name in inline assembly string">;
def err_asm_empty_symbolic_operand_name : Error<
def err_asm_empty_symbolic_operand_name : Error<
"empty symbolic operand name in inline assembly string">;
def err_asm_invalid_operand_number : Error<
def err_asm_invalid_operand_number : Error<
"invalid operand number in inline asm string">;
}
// Importing ASTs
def err_odr_variable_type_inconsistent : Error<

View File

@ -16,7 +16,8 @@ def err_fe_error_backend : Error<"error in backend: %0">, DefaultFatal;
def err_fe_invalid_ast_file : Error<"invalid AST file: '%0'">, DefaultFatal;
def err_fe_invalid_ast_action : Error<"invalid action for AST input">,
DefaultFatal;
def err_fe_inline_asm : Error<"%0">; // Error generated by the backend.
// Error generated by the backend.
def err_fe_inline_asm : Error<"%0">, CatInlineAsm;
def note_fe_inline_asm_here : Note<"generated from here">;
def err_fe_invalid_code_complete_file : Error<
"cannot locate code-completion file %0">, DefaultFatal;

View File

@ -13,9 +13,12 @@
let Component = "Parse" in {
def w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">;
def w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">,
CatInlineAsm;
def warn_file_asm_volatile : Warning<
"meaningless 'volatile' on asm outside function">;
"meaningless 'volatile' on asm outside function">, CatInlineAsm;
let CategoryName = "Parse Issue" in {
def ext_empty_source_file : Extension<"ISO C forbids an empty source file">;
def ext_top_level_semi : Extension<
@ -131,7 +134,7 @@ def err_label_end_of_compound_statement : Error<
"label at end of compound statement: expected statement">;
def err_expected_string_literal : Error<"expected string literal">;
def err_expected_asm_operand : Error<
"expected string literal or '[' for asm operand">;
"expected string literal or '[' for asm operand">, CatInlineAsm;
def err_expected_selector_for_method : Error<
"expected selector for Objective-C method">;
def err_expected_property_name : Error<"expected property name">;
@ -373,4 +376,5 @@ def warn_pragma_unused_expected_var : Warning<
def warn_pragma_unused_expected_punc : Warning<
"expected ')' or ',' in '#pragma unused'">;
} // end of Parse Issue category.
} // end of Parser diagnostics

View File

@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
let Component = "Sema" in {
let CategoryName = "Semantic Issue" in {
// Constant expressions
def err_expr_not_ice : Error<
@ -2581,30 +2582,34 @@ def err_incomplete_type_used_in_type_trait_expr : Error<
"incomplete type %0 used in type trait expression">;
def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
} // End of general sema category.
// inline asm.
def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
def err_asm_invalid_output_constraint : Error<
let CategoryName = "Inline Assembly Issue" in {
def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
def err_asm_invalid_output_constraint : Error<
"invalid output constraint '%0' in asm">;
def err_asm_invalid_lvalue_in_input : Error<
def err_asm_invalid_lvalue_in_input : Error<
"invalid lvalue in asm input for constraint '%0'">;
def err_asm_invalid_input_constraint : Error<
def err_asm_invalid_input_constraint : Error<
"invalid input constraint '%0' in asm">;
def err_asm_invalid_type_in_input : Error<
def err_asm_invalid_type_in_input : Error<
"invalid type %0 in asm input for constraint '%1'">;
def err_asm_tying_incompatible_types : Error<
def err_asm_tying_incompatible_types : Error<
"unsupported inline asm: input with type %0 matching output with type %1">;
def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
def err_invalid_asm_cast_lvalue : Error<
def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
def err_invalid_asm_cast_lvalue : Error<
"invalid use of a cast in a inline asm context requiring an l-value: "
"remove the cast or build with -fheinous-gnu-extensions">;
def warn_invalid_asm_cast_lvalue : Warning<
def warn_invalid_asm_cast_lvalue : Warning<
"invalid use of a cast in a inline asm context requiring an l-value: "
"accepted due to -fheinous-gnu-extensions, but clang may remove support "
"for this in the future">;
}
let CategoryName = "Semantic Issue" in {
def err_invalid_conversion_between_vectors : Error<
"invalid conversion between vector type %0 and %1 of different size">;
@ -3082,6 +3087,6 @@ def err_undeclared_protocol_suggest : Error<
def note_base_class_specified_here : Note<
"base class %0 specified here">;
}
} // end of sema category
} // end of sema component.