klimek added inline comments.
================
Comment at: clang-rename/USRLocFinder.cpp:106-113
@@ -105,3 +105,10 @@
if (getUSRForDecl(Decl) == USR) {
- LocationsFound.push_back(Expr->getMemberLoc());
+ SourceLocation Location = Expr->getMemberLoc();
+ if (Location.isMacroID()) {
+ // The location is expanded from a macro, look up the original spelling
+ // location.
+ const ASTContext &Context = Decl->getASTContext();
+ Location = Context.getSourceManager().getSpellingLoc(Location);
+ }
+ LocationsFound.push_back(Location);
}
----------------
Don't we just always want to do that?
Location =
Decl->getASTContext().getSourceManager().getSpellingLoc(Expr->getMemberLoc());
should always work.
http://reviews.llvm.org/D20446
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits