<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Check out DiagnosticCategories.td (which we seem not to be using so much!).</div><div><br></div><div>I think you can say</div><div><br></div><div><span></span>let CategoryName = MyCat.CategoryName {</div><div>...</div><div>}</div><div><br></div><div>to avoid having to inherit the category on every single diagnostic.</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On May 8, 2013, at 17:07 , Ted Kremenek <<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: kremenek<br>Date: Wed May  8 19:07:27 2013<br>New Revision: 181494<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=181494&view=rev">http://llvm.org/viewvc/llvm-project?rev=181494&view=rev</a><br>Log:<br>Put some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they are in other .td files.<br><br>I really dislike the copy-pasting of the category strings.  If there is a better<br>way to do this with TableGen, please advise.<br><br>Modified:<br>   cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=181494&r1=181493&r2=181494&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=181494&r1=181493&r2=181494&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Wed May  8 19:07:27 2013<br>@@ -37,6 +37,9 @@ def note_possibility : Note<"one possibi<br>def note_also_found : Note<"also found">;<br><br>// Parse && Lex<br>+<br>+let CategoryName = "Lexical or Preprocessor Issue" in {<br>+<br>def err_expected_colon : Error<"expected ':'">;<br>def err_expected_colon_after_setter_name : Error<<br>  "method name referenced in property setter attribute "<br>@@ -51,7 +54,12 @@ def err_invalid_character_udl : Error<<br>def err_invalid_numeric_udl : Error<<br>  "numeric literal with user-defined suffix cannot be used here">;<br><br>+}<br>+<br>// Parse && Sema<br>+<br>+let CategoryName = "Parse Issue" in {<br>+<br>def err_param_redefinition : Error<"redefinition of parameter %0">;<br>def warn_method_param_redefinition : Warning<"redefinition of method parameter %0">;<br>def warn_method_param_declaration : Warning<"redeclaration of method parameter %0">,<br>@@ -79,6 +87,8 @@ def err_attribute_not_type_attr : Error<<br>  "%0 attribute cannot be applied to types">;<br>def err_enum_template : Error<"enumeration cannot be a template">;<br><br>+}<br>+<br>// Sema && Lex<br>def ext_c99_longlong : Extension<<br>  "'long long' is an extension when C99 mode is not enabled">,<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></body></html>