This is an archive of the discontinued LLVM Phabricator instance.

clang-rename: add a -old-name option
ClosedPublic

Authored by vmiklos on Jun 20 2016, 1:31 AM.

Details

Summary

This is similar to -offset with the following differences:

  1. -offset can refer to local variables as well.
  1. -old-name makes it easier to refer to e.g. ClassName::MemberName by

spelling out the fully qualified name, instead of having to use e.g.
grep to look up the exact offset.

In other words, -offset is great when clang-rename is invoked by e.g. an
IDE, but not really user-friendly when the tool is invoked by the user
from commandline. That's the use case where -old-name is supposed to
improve the situation.

Diff Detail

Repository
rL LLVM

Event Timeline

vmiklos updated this revision to Diff 61237.Jun 20 2016, 1:31 AM
vmiklos retitled this revision from to clang-rename: add a -old-name option.
vmiklos updated this object.
vmiklos added a reviewer: klimek.
vmiklos added a subscriber: cfe-commits.
klimek added inline comments.Jun 20 2016, 8:12 AM
clang-rename/USRFinder.h
28–33 ↗(On Diff #61237)

These seem to be fundamentally different use cases. Can we add a new top-level function instead?
It seems like the new case would have a much simpler implementation.

vmiklos updated this revision to Diff 61255.Jun 20 2016, 9:05 AM
vmiklos updated this object.

Added a getNamedDeclFor() for the fully qualified name-based search.

klimek accepted this revision.Jun 21 2016, 11:43 AM
klimek edited edge metadata.

LG

This revision is now accepted and ready to land.Jun 21 2016, 11:44 AM
This revision was automatically updated to reflect the committed changes.