This is an archive of the discontinued LLVM Phabricator instance.

[clang-rename] improve USRFindingAction
ClosedPublic

Authored by omtcyfz on Aug 2 2016, 6:03 AM.

Details

Summary
  • improve templated class renaming, namely add capabilities of finding partial and full specializations
  • fix virtual function and their overriding functions renaming

Diff Detail

Repository
rL LLVM

Event Timeline

omtcyfz updated this revision to Diff 66462.Aug 2 2016, 6:03 AM
omtcyfz retitled this revision from to [clang-rename] add support for template instantiations.
omtcyfz updated this object.
omtcyfz added reviewers: alexfh, klimek.
omtcyfz added a subscriber: cfe-commits.
alexfh requested changes to this revision.Aug 2 2016, 1:31 PM
alexfh edited edge metadata.
alexfh added inline comments.
test/clang-rename/TemplateClassInstantiationFindByDeclaration.cpp
2 ↗(On Diff #66462)

It makes sense to move RUN lines to the end of the file (and add -fno-delayed-template-parsing, if windows buildbots start complaining).

test/clang-rename/TemplateClassInstantiationFindByUninstantiatedType.cpp
2 ↗(On Diff #66462)

This test looks exactly as the one above except for the offset. Instead of duplicating tests, we can run clang-rename multiple times and use different -check-prefix with FileCheck. In this case moving the RUN lines to the bottom makes even more sense.

Also, instructions for updating -offset are incorrect, if you have multiple different offsets.

This revision now requires changes to proceed.Aug 2 2016, 1:31 PM
omtcyfz added inline comments.Aug 3 2016, 1:38 AM
test/clang-rename/TemplateClassInstantiationFindByUninstantiatedType.cpp
2 ↗(On Diff #66462)

Will it work if I add multiple invocations while not adding different -check-prefix? The replacements are the same across the runs.

omtcyfz added inline comments.Aug 3 2016, 1:46 AM
test/clang-rename/TemplateClassInstantiationFindByDeclaration.cpp
2 ↗(On Diff #66462)

It makes sense to move RUN lines to the end of the file

You mean for all tests?

omtcyfz updated this revision to Diff 66634.Aug 3 2016, 3:09 AM
omtcyfz edited edge metadata.
omtcyfz retitled this revision from [clang-rename] add support for template instantiations to [clang-rename] improve USRFindingAction.
omtcyfz updated this object.
omtcyfz edited edge metadata.
omtcyfz updated this revision to Diff 66642.Aug 3 2016, 4:13 AM

Removed dump() call used for debugging purposes.
Removed unneeded header inclusion in USRFindingAction.cpp.

alexfh added inline comments.Aug 3 2016, 6:10 AM
test/clang-rename/TemplateClassInstantiationFindByDeclaration.cpp
2 ↗(On Diff #66642)

Yes, but it's better to modify unrelated tests in a separate patch.

test/clang-rename/TemplateClassInstantiationFindByUninstantiatedType.cpp
3 ↗(On Diff #66642)

Yep, should also work with the same check prefix, if the replacements are the same.

omtcyfz updated this revision to Diff 66670.Aug 3 2016, 8:34 AM

Merged multiple identical tests into a single test with multiple clang-rename invocations.

omtcyfz marked 2 inline comments as done.Aug 3 2016, 8:34 AM
omtcyfz added inline comments.
test/clang-rename/TemplateClassInstantiationFindByUninstantiatedType.cpp
3 ↗(On Diff #66642)

Done.

alexfh accepted this revision.Aug 3 2016, 3:33 PM
alexfh edited edge metadata.

LG

This revision is now accepted and ready to land.Aug 3 2016, 3:33 PM
This revision was automatically updated to reflect the committed changes.
omtcyfz marked an inline comment as done.
clang-tools-extra/trunk/test/clang-rename/TemplateClassInstantiationFindByDeclaration.cpp