diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-23 21:02:30 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-23 21:02:30 +0000 |
commit | f6a3b0ca4be4852a6696ae26e5dca1105876d875 (patch) | |
tree | e98938c743e27abb152c50d4d296b386d06268f0 /clang/lib | |
parent | 296374b5015aa82bdbfdf852bc3ed6031633dbec (diff) | |
download | bcm5719-llvm-f6a3b0ca4be4852a6696ae26e5dca1105876d875.tar.gz bcm5719-llvm-f6a3b0ca4be4852a6696ae26e5dca1105876d875.zip |
In Lexer::isAtEndOfMacroExpansion use SourceManager::isInFileID and avoid
the extra SourceManager::getFileID call.
llvm-svn: 138376
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 25f07c9e4f1..d8ebc9ffe6b 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -755,14 +755,12 @@ bool Lexer::isAtEndOfMacroExpansion(SourceLocation loc, FileID FID = SM.getFileID(loc); SourceLocation afterLoc = loc.getFileLocWithOffset(tokLen+1); - if (!SM.isBeforeInSourceLocationOffset(afterLoc, SM.getNextLocalOffset())) - return true; // We got past the last FileID, this points to the last token. + if (SM.isInFileID(afterLoc, FID)) + return false; // Still in the same FileID, does not point to the last token. // FIXME: If the token comes from the macro token paste operator ('##') // or the stringify operator ('#') this function will always return false; - if (FID == SM.getFileID(afterLoc)) - return false; // Still in the same FileID, does not point to the last token. - + SourceLocation expansionLoc = SM.getSLocEntry(FID).getExpansion().getExpansionLocEnd(); if (expansionLoc.isFileID()) |