summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r--clang/lib/Lex/TokenLexer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp
index 7f3be700c68..994bae632ae 100644
--- a/clang/lib/Lex/TokenLexer.cpp
+++ b/clang/lib/Lex/TokenLexer.cpp
@@ -787,9 +787,6 @@ static void updateConsecutiveMacroArgTokens(SourceManager &SM,
if (CurLoc.isFileID() != NextLoc.isFileID())
break; // Token from different kind of FileID.
- if (CurLoc.isMacroID() && !SM.isWrittenInSameFile(CurLoc, NextLoc))
- break; // Token from a different macro.
-
int RelOffs;
if (!SM.isInSameSLocAddrSpace(CurLoc, NextLoc, &RelOffs))
break; // Token from different local/loaded location.
@@ -797,6 +794,10 @@ static void updateConsecutiveMacroArgTokens(SourceManager &SM,
// "characters" away.
if (RelOffs < 0 || RelOffs > 50)
break;
+
+ if (CurLoc.isMacroID() && !SM.isWrittenInSameFile(CurLoc, NextLoc))
+ break; // Token from a different macro.
+
CurLoc = NextLoc;
}
OpenPOWER on IntegriCloud