diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-11 17:29:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-11 17:29:44 +0000 |
commit | 7a70d2f11bb1db242d004ca950ce858b09b80d0a (patch) | |
tree | ae934230c795b1011ce649698b0b8732c8b5ddfd /clang/lib/Lex/PPLexerChange.cpp | |
parent | ad018f10bcfc58e33dc52773b523360441adba2e (diff) | |
download | bcm5719-llvm-7a70d2f11bb1db242d004ca950ce858b09b80d0a.tar.gz bcm5719-llvm-7a70d2f11bb1db242d004ca950ce858b09b80d0a.zip |
For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.
llvm-svn: 141681
Diffstat (limited to 'clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index 8ba2df9b036..25a98ae47b6 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/lib/Lex/PPLexerChange.cpp @@ -256,6 +256,10 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { SourceMgr.setNumCreatedFIDsForFileID(CurPPLexer->getFileID(), NumFIDs); } + FileID ExitedFID; + if (Callbacks && !isEndOfMacro && CurPPLexer) + ExitedFID = CurPPLexer->getFileID(); + // We're done with the #included file. RemoveTopOfLexerStack(); @@ -264,7 +268,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { SrcMgr::CharacteristicKind FileType = SourceMgr.getFileCharacteristic(CurPPLexer->getSourceLocation()); Callbacks->FileChanged(CurPPLexer->getSourceLocation(), - PPCallbacks::ExitFile, FileType); + PPCallbacks::ExitFile, FileType, ExitedFID); } // Client should lex another token. |