Skip to content
Snippets Groups Projects
Commit 8c61b53f authored by Chris Lattner's avatar Chris Lattner
Browse files

do not use SourceManager::getFileCharacteristic(FileID), it is not

safe because a #line can change the file characteristic on a per-loc
basis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62502 91177308-0d34-0410-b5e6-96231b3b80d8
parent 693faa6e
No related branches found
No related tags found
No related merge requests found
......@@ -118,9 +118,10 @@ void Preprocessor::EnterSourceFileWithPTH(PTHLexer *PL,
// Notify the client, if desired, that we are in a new source file.
if (Callbacks) {
FileID FID = CurPPLexer->getFileID();
SrcMgr::CharacteristicKind FileType = SourceMgr.getFileCharacteristic(FID);
Callbacks->FileChanged(SourceMgr.getLocForStartOfFile(FID),
PPCallbacks::EnterFile, FileType);
SourceLocation EnterLoc = SourceMgr.getLocForStartOfFile(FID);
SrcMgr::CharacteristicKind FileType =
SourceMgr.getFileCharacteristic(EnterLoc);
Callbacks->FileChanged(EnterLoc, PPCallbacks::EnterFile, FileType);
}
}
......@@ -194,9 +195,9 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
// Notify the client, if desired, that we are in a new source file.
if (Callbacks && !isEndOfMacro && CurPPLexer) {
SrcMgr::CharacteristicKind FileType =
SourceMgr.getFileCharacteristic(CurPPLexer->getFileID());
Callbacks->FileChanged(CurPPLexer->getSourceLocation(),
PPCallbacks::ExitFile, FileType);
SourceMgr.getFileCharacteristic(CurPPLexer->getSourceLocation());
Callbacks->FileChanged(CurPPLexer->getSourceLocation(),
PPCallbacks::ExitFile, FileType);
}
// Client should lex another token.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment