This is an archive of the discontinued LLVM Phabricator instance.

[diagtool] Add the 'find-diagnostic-id' subcommand that converts a name of the diagnostic to its enum value
ClosedPublic

Authored by arphaman on Jul 12 2017, 7:51 AM.

Details

Summary

The new subcommand prints out the enum value of the diagnostic. This will be used in a utility script that invokes clang and forces it to stop when some specific diagnostic is emitted (see https://reviews.llvm.org/D35175 for discussion).

@hintonda
My current script only deals with one specific diagnostic (i.e. the enum name). I was thinking that it could be extended to support diagnostic groups (i.e. -W options), where it would stop at any warning from that group. This extension will require an addition to this patch (i.e. if you supply -Wgroupname, we will print out a list of diagnostic ids instead of just one id that corresponds to the specific diagnostic). Do you think this will be useful?

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Jul 12 2017, 7:51 AM
hintonda accepted this revision.Jul 12 2017, 8:44 AM

LGTM.

Category ids' might be useful, but I'd wait until someone actually needs them.

This revision is now accepted and ready to land.Jul 12 2017, 8:44 AM
This revision was automatically updated to reflect the committed changes.