This is an archive of the discontinued LLVM Phabricator instance.

[include-cleaner] Use RAV instead of ASTMatchers in LocateSymbolTest
ClosedPublic

Authored by kadircet on Dec 1 2022, 2:58 AM.

Details

Summary

ASTMatchers are pulling in lots of dependencies that we don't really
need for just finding a decl based on name. So use a simple RAV instead.

Diff Detail

Event Timeline

kadircet created this revision.Dec 1 2022, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 2:58 AM
kadircet requested review of this revision.Dec 1 2022, 2:58 AM
Herald added a project: Restricted Project. · View Herald Transcript
sammccall accepted this revision.Dec 1 2022, 3:23 AM
sammccall added inline comments.
clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
60

you might want to EXPECT_EQ(Out, nullptr) first to ensure only a single match

(A single match for a name may not generalize well, but the matching would have to be made more specific regardless in that case)

This revision is now accepted and ready to land.Dec 1 2022, 3:23 AM
kadircet marked an inline comment as done.Dec 1 2022, 3:36 AM
kadircet added inline comments.
clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
60

we expect to see multiple declarations for the same entity anyway though, so instead of asserting null, i'll assert same canonical or null.

This revision was automatically updated to reflect the committed changes.
kadircet marked an inline comment as done.