This is an archive of the discontinued LLVM Phabricator instance.

[Tooling] Add more scope specifiers until spelling is not ambiguous.
ClosedPublic

Authored by ioeric on Mar 18 2019, 5:59 AM.

Details

Summary

Previously, when the renamed spelling is ambiguous, we simply use the
full-qualfied name (with leading "::"). This patch makes it try adding
additional specifiers one at a time until name is no longer ambiguous,
which allows us to find better disambuguated spelling.

Diff Detail

Repository
rL LLVM

Event Timeline

ioeric created this revision.Mar 18 2019, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2019, 5:59 AM
kadircet accepted this revision.Mar 18 2019, 9:00 AM

LGTM

lib/Tooling/Core/Lookup.cpp
165 ↗(On Diff #191070)

maybe return or break afterwards?

This revision is now accepted and ready to land.Mar 18 2019, 9:00 AM
ioeric marked 2 inline comments as done.Mar 18 2019, 9:34 AM
ioeric added inline comments.
lib/Tooling/Core/Lookup.cpp
165 ↗(On Diff #191070)

I also struggled a bit here. But I decided to let IsAmbiguousSpelling handle it because it seemed a bit more natural. Otherwise, we would somewhat duplicate the logic that spelling with leading "::" is not ambiguous.

kadircet added inline comments.Mar 19 2019, 1:39 AM
lib/Tooling/Core/Lookup.cpp
165 ↗(On Diff #191070)

ok sgtm

This revision was automatically updated to reflect the committed changes.
ioeric marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2019, 3:11 AM