[cfe-dev] Place for shared diagnostic utility function?

Jordan Rose jordan_rose at apple.com
Thu Aug 16 09:04:24 PDT 2012


On Aug 15, 2012, at 21:34 , David Robins <llvm at davidrobins.net> wrote:

> Clang style question: Now that many places that used to be
> {struct|class} in DiagnosticSemaKinds.td are {struct|interface|class},
> I've been writing short static getXDiagFromTagKind functions to return
> the diag index given a TTK value. There are now 3 sema and 1 ast file
> that require such a function; is there a good place to share it, or is
> it preferred to include appropriate copies near their use for locality?

It might actually be simpler to reorder the TTK enums and then just use them DIRECTLY in diagnostics. 'struct', 'class', and 'interface' would all belong together. 'union' sometimes also belongs there. And 'enum' would still be last.

What does the list think?




More information about the cfe-dev mailing list