From: Chris Lattner Date: Mon, 19 Jan 2009 07:59:15 +0000 (+0000) Subject: do not use SourceManager::getFileCharacteristic(FileID), it is not X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=693faa6e6918994bc22aacf078a889bb93e0fe25;p=clang 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@62501 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index f7551a2532..ef26aeb79a 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -783,7 +783,7 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, // header. SrcMgr::CharacteristicKind FileCharacter = std::max(HeaderInfo.getFileDirFlavor(File), - SourceMgr.getFileCharacteristic(getCurrentFileLexer()->getFileID())); + SourceMgr.getFileCharacteristic(FilenameTok.getLocation())); // Look up the file, create a File ID for it. FileID FID = SourceMgr.createFileID(File, FilenameTok.getLocation(),