[PATCH] D35175: New option that adds the DiagID enum name and index to Diagnostic output.
don hinton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 9 06:15:09 PDT 2017
hintonda created this revision.
This option helps locate the origin of a diagnostic message
by outputing the enum name and index associated with a specific
DiagID, allowing users to grep the code for the enum name directly
without having to find it in the td files first.
Additional ideas:
1. add another option to pass in the index (or enum) to force an assert or backtrace when a specific DiagID is seen.
2. capture __FILE__ and __LINE__ when a diagnostic is created and output it. This would make it easier to find the specific instance, and verify all instances are actually tested. Currently, it's almost impossible to determine if all instances are actually tested.
3. keep track of the permutations and make sure each one is tested.
https://reviews.llvm.org/D35175
Files:
include/clang/Basic/DiagnosticIDs.h
include/clang/Basic/DiagnosticOptions.def
include/clang/Driver/Options.td
lib/Basic/DiagnosticIDs.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/TextDiagnosticPrinter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35175.105753.patch
Type: text/x-patch
Size: 5240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170709/09bc6da8/attachment-0001.bin>
More information about the cfe-commits
mailing list