klimek 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.
----------------
vmiklos wrote:
> 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. :-)
Yep, if you want to get an identifier, you just get the code for the range
getLocation(), getLocation() (note that ranges are inclusive token-ranges by
default)
http://reviews.llvm.org/D20216
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits