This is an archive of the discontinued LLVM Phabricator instance.

clang-rename: fix renaming of field with implicit initializers
ClosedPublic

Authored by vmiklos on May 11 2016, 12:44 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

vmiklos updated this revision to Diff 56854.May 11 2016, 12:44 AM
vmiklos retitled this revision from to clang-rename: fix renaming of field with implicit initializers.
vmiklos updated this object.
vmiklos added reviewers: cfe-commits, klimek.
klimek accepted this revision.May 11 2016, 12:51 AM
klimek edited edge metadata.

LG

clang-rename/USRLocFinder.cpp
64 ↗(On Diff #56854)

Add a comment like:
// The source location of implicit initializers is the constructor declaration.

Also: should we add a check that the token of the source location we find actually has the old name?

This revision is now accepted and ready to land.May 11 2016, 12:51 AM
This revision was automatically updated to reflect the committed changes.
vmiklos added inline comments.May 11 2016, 1:18 AM
clang-rename/USRLocFinder.cpp
64 ↗(On Diff #56854)

I don't know off the top of my head a situation where this is needed, but sure, sounds like a useful safety check. I'll have a look.

Hi,

Also: should we add a check that the token of the source location we find actually has the old name?

Hmm, how do I get the token at a specific SourceLocation? The best I found so far is SourceManager::getBuffer(), but that looks more like looking up raw bytes from the source file at a location, not a token.

Thanks,

Miklos