This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Use new mapping matchers
ClosedPublic

Authored by steveire on Jan 5 2021, 3:33 PM.

Details

Summary
Use mapAnyOf() and matchers based on it.

Use of binaryOperation() means that modernize-loop-convert and
readability-container-size-empty can now be used with rewritten binary
operators.

Diff Detail

Event Timeline

steveire created this revision.Jan 5 2021, 3:33 PM
steveire requested review of this revision.Jan 5 2021, 3:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2021, 3:33 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Theres a few compile errors here in the pre merge. Is this patch based against trunk or some local branch?

clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
313

This doesn't compile and it appears unrelated. Same beloe

clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp
32–33

Any reason for clang not finding this?

aaron.ballman accepted this revision.Jan 11 2021, 6:58 AM

Theres a few compile errors here in the pre merge. Is this patch based against trunk or some local branch?

It's a patch series but for some reason Phab isn't aware of that, hence the lint errors and seemingly odd use of things not already landed.

LGTM

This revision is now accepted and ready to land.Jan 11 2021, 6:58 AM
njames93 requested changes to this revision.Jan 16 2021, 1:27 PM

Can you either update the description of this patch to include the binaryOperation changes, or remove those changes from here.

clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp
62–65

While were here, this allOf matcher could be removed.

clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
43–47

nit: Can this unrelated change be removed from this patch.

clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
313

nit: ditto.

clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp
33–35

And here.

42

Here.

clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
213–216

Also unrelated.

clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
186–190

Also unrelated.

clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
52–56

Unrelated changes again.

clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
74–75

Unrelated change.

182–188

Unrelated change

clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
69–72

Unrelated change.

This revision now requires changes to proceed.Jan 16 2021, 1:27 PM
steveire retitled this revision from [clang-tidy] Use new mapAnyOf matcher to [clang-tidy] Use new mapping matchers.Feb 3 2021, 2:26 PM
steveire edited the summary of this revision. (Show Details)
njames93 accepted this revision.Feb 3 2021, 2:29 PM
This revision is now accepted and ready to land.Feb 3 2021, 2:29 PM
This revision was landed with ongoing or failed builds.Feb 3 2021, 3:21 PM
This revision was automatically updated to reflect the committed changes.