Hi, everyone. One thing that's bothered me about our diagnostic TableGen files is the anonymous use of warning groups:

def warn_foo : Warning<"foo is bad">, InGroup<DiagGroup<"foo">>;
def warn_foo_cxx : Warning<"foo is even worse in C++">, InGroup<DiagGroup<"foo">>;

If we ever want to put the warning groups in a hierarchy, or change the name, there's a big chance we'll miss one.

So, I wrote a new warning for clang-tblgen, which even has a fixit if the group already has a name:

warning: group 'foo' is referred to anonymously
def warn_foo : Warning<"foo is bad">, InGroup<DiagGroup<"foo">>;
                                      ~~~~~~~~^~~~~~~~~~~~~~~~~
                                      InGroup<Foo>

And then fixed all the warnings, with the intent that we make this a new style requirement going forwards: groups that cover more than one diagnostic must be named.

This depends on the changes being discussed in http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130107/161252.html, but what do people think of this?

Thanks,
Jordan

Attachment: 0001-Warn-if-an-anonymous-DiagGroup-is-referenced-multipl.patch
Description: Binary data

Attachment: 0002-Diagnostics-name-all-implicit-groups-used-more-than-.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to