This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Move Checkname out of Diagnostic Message
Needs ReviewPublic

Authored by njames93 on Feb 24 2021, 1:51 PM.

Details

Summary

Repurpose the FlagValue field in DiagnosticEngine to store the Checkname.
This removes the need to remove the checkname from the message when we process the diagnostic later.

I looked at a few options and FlagValue seems the simplest way to implement this.
Its only ever read when there is a warning option for the given DiagnosticID, which will never happen for clang-tidy checks.

Removing the Checkname is also a necessary first step if we ever want to support tablegen diagnostics route for clang-tidy.

Diff Detail

Event Timeline

njames93 created this revision.Feb 24 2021, 1:51 PM
aaron.ballman added inline comments.Feb 25 2021, 5:45 AM
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
170–171
njames93 published this revision for review.Feb 25 2021, 5:51 AM
njames93 added a subscriber: NoQ.

@NoQ This may have a little impact on D95403, but from what I can see nothing mayor would conflict. It was fairly easy to fix up clang d integration.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2021, 5:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
njames93 updated this revision to Diff 326418.Feb 25 2021, 9:06 AM
njames93 marked an inline comment as done.

Typo.