aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteMacros.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/RewriteMacros.cpp')
-rw-r--r--lib/Rewrite/RewriteMacros.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Rewrite/RewriteMacros.cpp b/lib/Rewrite/RewriteMacros.cpp
index d1dda91ad0..d56910037c 100644
--- a/lib/Rewrite/RewriteMacros.cpp
+++ b/lib/Rewrite/RewriteMacros.cpp
@@ -112,7 +112,7 @@ void clang::RewriteMacrosInInput(Preprocessor &PP, raw_ostream *OS) {
// that aren't in the preprocessed view, we have macros that expand to no
// tokens, or macro arguments etc.
while (RawTok.isNot(tok::eof) || PPTok.isNot(tok::eof)) {
- SourceLocation PPLoc = SM.getInstantiationLoc(PPTok.getLocation());
+ SourceLocation PPLoc = SM.getExpansionLoc(PPTok.getLocation());
// If PPTok is from a different source file, ignore it.
if (!SM.isFromMainFile(PPLoc)) {
@@ -197,7 +197,7 @@ void clang::RewriteMacrosInInput(Preprocessor &PP, raw_ostream *OS) {
while (PPOffs < RawOffs) {
Expansion += ' ' + PP.getSpelling(PPTok);
PP.Lex(PPTok);
- PPLoc = SM.getInstantiationLoc(PPTok.getLocation());
+ PPLoc = SM.getExpansionLoc(PPTok.getLocation());
PPOffs = SM.getFileOffset(PPLoc);
}
Expansion += ' ';