[PATCH] D20216: clang-rename: check that the source location we find actually has the old name
Miklos Vajna via cfe-commits
cfe-commits at lists.llvm.org
Fri May 13 01:13:40 PDT 2016
vmiklos added inline comments.
================
Comment at: clang-rename/USRLocFinder.cpp:75
@@ +74,3 @@
+ StringRef TokenName = Lexer::getSourceText(CharSourceRange::getTokenRange(Range), Context.getSourceManager(), Context.getLangOpts());
+ if (TokenName.startswith(PrevName)) {
+ // The token of the source location we find actually has the old name.
----------------
klimek wrote:
> Why startswith as opposed to ==?
The source range is "foo(0)", the old name is "foo". Or is there a way to get the range of the name part of the initializer, without the "(0)" part?
I'll fix the rest, those are easy. :-)
http://reviews.llvm.org/D20216
More information about the cfe-commits
mailing list