From 7a70d2f11bb1db242d004ca950ce858b09b80d0a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 11 Oct 2011 17:29:44 +0000 Subject: For the FileChanged Preprocessor callback, when exiting a file, pass its FileID. llvm-svn: 141681 --- clang/lib/Lex/PPLexerChange.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/Lex/PPLexerChange.cpp') 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. -- cgit v1.2.3