diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
commit | 8aaf5818a64e9f7687798852af5945b053c68a54 (patch) | |
tree | d6a70c3518b8dea8be7062438d7e8676820ed17f /lib/Lex/PPDirectives.cpp | |
parent | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (diff) | |
download | FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.zip FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.tar.gz |
Update clang to r103004.
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 757ba90..417724b 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -716,7 +716,8 @@ void Preprocessor::HandleLineDirective(Token &Tok) { SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID); if (Callbacks) - Callbacks->FileChanged(DigitTok.getLocation(), PPCallbacks::RenameFile, + Callbacks->FileChanged(CurPPLexer->getSourceLocation(), + PPCallbacks::RenameFile, SrcMgr::C_User); } @@ -865,7 +866,7 @@ void Preprocessor::HandleDigitDirective(Token &DigitTok) { else if (IsSystemHeader) FileKind = SrcMgr::C_System; - Callbacks->FileChanged(DigitTok.getLocation(), Reason, FileKind); + Callbacks->FileChanged(CurPPLexer->getSourceLocation(), Reason, FileKind); } } @@ -1087,11 +1088,6 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, return; } - // Ask HeaderInfo if we should enter this #include file. If not, #including - // this file will have no effect. - if (!HeaderInfo.ShouldEnterIncludeFile(File, isImport)) - return; - // The #included file will be considered to be a system header if either it is // in a system include directory, or if the #includer is a system include // header. @@ -1099,6 +1095,14 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, std::max(HeaderInfo.getFileDirFlavor(File), SourceMgr.getFileCharacteristic(FilenameTok.getLocation())); + // Ask HeaderInfo if we should enter this #include file. If not, #including + // this file will have no effect. + if (!HeaderInfo.ShouldEnterIncludeFile(File, isImport)) { + if (Callbacks) + Callbacks->FileSkipped(*File, FilenameTok, FileCharacter); + return; + } + // Look up the file, create a File ID for it. FileID FID = SourceMgr.createFileID(File, FilenameTok.getLocation(), FileCharacter); @@ -1108,10 +1112,7 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, } // Finally, if all is good, enter the new file! - std::string ErrorStr; - if (EnterSourceFile(FID, CurDir, ErrorStr)) - Diag(FilenameTok, diag::err_pp_error_opening_file) - << std::string(SourceMgr.getFileEntryForID(FID)->getName()) << ErrorStr; + EnterSourceFile(FID, CurDir, FilenameTok.getLocation()); } /// HandleIncludeNextDirective - Implements #include_next. @@ -1666,4 +1667,3 @@ void Preprocessor::HandleElifDirective(Token &ElifToken) { return SkipExcludedConditionalBlock(CI.IfLoc, /*Foundnonskip*/true, /*FoundElse*/CI.FoundElse); } - |