]> granicus.if.org Git - clang/commitdiff
do not use SourceManager::getFileCharacteristic(FileID), it is not
authorChris Lattner <sabre@nondot.org>
Mon, 19 Jan 2009 07:59:15 +0000 (07:59 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 19 Jan 2009 07:59:15 +0000 (07:59 +0000)
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

lib/Lex/PPDirectives.cpp

index f7551a2532ffa3949239a47ee9931b1db01710bb..ef26aeb79a6cc33ad409f80bdeda9ec3b8cf2c9a 100644 (file)
@@ -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(),