[cfe-commits] r104561 - in /cfe/trunk: docs/UsersManual.html include/clang/Basic/Diagnostic.td include/clang/Basic/DiagnosticASTKinds.td include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td

Chris Lattner sabre at nondot.org
Mon May 24 14:35:19 PDT 2010


Author: lattner
Date: Mon May 24 16:35:18 2010
New Revision: 104561

URL: http://llvm.org/viewvc/llvm-project?rev=104561&view=rev
Log:
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.

Modified:
    cfe/trunk/docs/UsersManual.html
    cfe/trunk/include/clang/Basic/Diagnostic.td
    cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td

Modified: cfe/trunk/docs/UsersManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.html?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/docs/UsersManual.html (original)
+++ cfe/trunk/docs/UsersManual.html Mon May 24 16:35:18 2010
@@ -36,6 +36,7 @@
    <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 @@
 <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 @@
 <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 @@
 <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>
 

Modified: cfe/trunk/include/clang/Basic/Diagnostic.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.td?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.td (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.td Mon May 24 16:35:18 2010
@@ -42,7 +42,10 @@
 //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"
 
 

Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Mon May 24 16:35:18 2010
@@ -14,17 +14,20 @@
 def note_expr_divide_by_zero : Note<"division by zero">;
 
 // inline asm related.
-def err_asm_invalid_escape : Error<
-  "invalid %% escape in inline assembly string">;
-def err_asm_unknown_symbolic_operand_name : Error<
-  "unknown symbolic operand name in inline assembly string">;
+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<
+    "unknown symbolic operand name in inline assembly string">;
+
+  def err_asm_unterminated_symbolic_operand_name : Error<
+    "unterminated symbolic operand name in inline assembly string">;
+  def err_asm_empty_symbolic_operand_name : Error<
+    "empty symbolic operand name in inline assembly string">;
+  def err_asm_invalid_operand_number : Error<
+    "invalid operand number in inline asm string">;
+}
 
-def err_asm_unterminated_symbolic_operand_name : Error<
-  "unterminated symbolic operand name in inline assembly string">;
-def err_asm_empty_symbolic_operand_name : Error<
-  "empty symbolic operand name in inline assembly string">;
-def err_asm_invalid_operand_number : Error<
-  "invalid operand number in inline asm string">;
 
 // Importing ASTs
 def err_odr_variable_type_inconsistent : Error<

Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Mon May 24 16:35:18 2010
@@ -16,7 +16,8 @@
 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;

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Mon May 24 16:35:18 2010
@@ -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 @@
   "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_punc : Warning<
   "expected ')' or ',' in '#pragma unused'">;
 
+} // end of Parse Issue category.
 } // end of Parser diagnostics

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=104561&r1=104560&r2=104561&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon May 24 16:35:18 2010
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 let Component = "Sema" in {
+let CategoryName = "Semantic Issue" in {
 
 // Constant expressions
 def err_expr_not_ice : Error<
@@ -2580,31 +2581,35 @@
 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 '('">;
-  
-// 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<
-  "invalid output constraint '%0' in asm">;
-def err_asm_invalid_lvalue_in_input : Error<
-  "invalid lvalue in asm input for constraint '%0'">;
-def err_asm_invalid_input_constraint : Error<
-  "invalid input constraint '%0' in asm">;
-def err_asm_invalid_type_in_input : Error<
-  "invalid type %0 in asm input for constraint '%1'">;
-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<
-  "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<
-  "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">;
 
+} // End of general sema category.
 
+// inline asm.
+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<
+    "invalid lvalue in asm input for constraint '%0'">;
+  def err_asm_invalid_input_constraint : Error<
+    "invalid input constraint '%0' in asm">;
+  def err_asm_invalid_type_in_input : Error<
+    "invalid type %0 in asm input for constraint '%1'">;
+  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<
+    "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<
+    "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 note_base_class_specified_here : Note<
   "base class %0 specified here">;
 
-}
-
+} // end of sema category
+} // end of sema component.
 





More information about the cfe-commits mailing list