This is an archive of the discontinued LLVM Phabricator instance.

Consistently handle clang-tidy check names in ClangTidyError.
ClosedPublic

Authored by alexfh on Jul 1 2014, 8:37 AM.

Details

Summary

This patch removes " [check-name]" from the end of
ClangTidyMessage::Message. The " [check-name]" part is only appended when
printing diagnostics on the console. Clang errors are now marked with
"clang-diagnostic-error" check name, remarks and unknown warnings are marked
with "clang-diagnostic-unknown".

Diff Detail

Event Timeline

alexfh updated this revision to Diff 11000.Jul 1 2014, 8:37 AM
alexfh retitled this revision from to Consistently handle clang-tidy check names in ClangTidyError..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: djasper.
alexfh added a subscriber: Unknown Object (MLST).
djasper added inline comments.Jul 1 2014, 8:51 AM
clang-tidy/ClangTidyDiagnosticConsumer.cpp
278

So, this is true if Context.getCheckName(Info.getID()) returns "", right? In which cases does this happen?

298

nit: "Don't mute" does not seem to be exactly what this does. It seems to be more of a "Force reporting of".

alexfh updated this revision to Diff 11001.Jul 1 2014, 9:09 AM

Added a comment.

clang-tidy/ClangTidyDiagnosticConsumer.cpp
278

Context.getCheckName returns non-empty string iff the diagnostic was generated using Context.diag, i.e. for all clang-tidy diagnostics. Compiler diagnostics may have warning option, which will be returned by getWarningOptionForDiag. If a compiler diagnostic doesn't have a warning option, CheckName remains empty. This is (almost?) always true for compiler errors (except for the ones mapped with -Werror). I've added a comment to the code to clarify this a bit.

298

Done.

djasper accepted this revision.Jul 2 2014, 8:11 AM
djasper edited edge metadata.

Looks good!

This revision is now accepted and ready to land.Jul 2 2014, 8:11 AM
alexfh closed this revision.Jul 2 2014, 8:13 AM