r181494 - Put some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they are in other .td files.

Ted Kremenek kremenek at apple.com
Wed May 8 17:26:31 PDT 2013


I tried that and it doesn't work.  The categories are classes, not values.

On May 8, 2013, at 5:16 PM, Jordan Rose <jordan_rose at apple.com> wrote:

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130508/2fac684c/attachment.html>


More information about the cfe-commits mailing list