[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
Tue Jul 11 21:10:04 PDT 2017


hintonda added a comment.

It's just an effort to make the code a bit more accessible, especially for new users (or ones not used to running find/grep).

Steve had suggested adding an option that took the entire message and matched it when it was produced.  However, that won't work very well since the message isn't actually produced until just before it is printed, which means the assert/backtrace isn't in the correctly location if the it's delayed.  That's why I chose to simply print just the enum name and index.

Adding `__FILE__`/`__LINE__` info would help identify the exact location (could be multiple for the same error message), but due to the way the code is structured it isn't really doable.

It might be kinda fun writing the script you suggest -- I'll look into it, but printing the enum in the first place for little or no cost seems a bit more elegant.


https://reviews.llvm.org/D35175





More information about the cfe-commits mailing list