This is an archive of the discontinued LLVM Phabricator instance.

Applying clang-tidy modernize-use-override over LLDB
ClosedPublic

Authored by shafik on Apr 7 2022, 2:35 PM.

Details

Summary

Applied clang-tidy modernize-use-override over LLDB and added it to the LLDB .clang-tidy config.

Diff Detail

Event Timeline

shafik created this revision.Apr 7 2022, 2:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 2:35 PM
shafik requested review of this revision.Apr 7 2022, 2:35 PM
JDevlieghere accepted this revision.Apr 7 2022, 3:26 PM

LGTM modulo the redundant comment

lldb/unittests/Target/RemoteAwarePlatformTest.cpp
40–41
This revision is now accepted and ready to land.Apr 7 2022, 3:26 PM
labath added a comment.Apr 8 2022, 1:25 AM

The reason for the funny /*override*/ thingy in the mock classes is that it is impossible (in the gmock version that we use) to add the override keyword to the methods overridden by the MOCK macros. Then, having override keywords on hand-written methods triggered -Winconsistent-missing-override.

Or at least it used to -- have you checked that these changes don't introduce any new compiler warnings?

The reason for the funny /*override*/ thingy in the mock classes is that it is impossible (in the gmock version that we use) to add the override keyword to the methods overridden by the MOCK macros. Then, having override keywords on hand-written methods triggered -Winconsistent-missing-override.

Or at least it used to -- have you checked that these changes don't introduce any new compiler warnings?

I missed that, it does indeed trigger the same warning, I guess I will add a NOLINT

shafik updated this revision to Diff 423725.Apr 19 2022, 1:40 PM

-Removed override RemoteAwarePlatformTest.cpp and added NOLINT

labath accepted this revision.Apr 20 2022, 2:38 AM

Yeah, I suppose we can do that. If this turns out to be more widespread, then I'd rather disable the tidy check (or perhaps the clang warning) for the unittest files instead.

Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 1:29 PM