diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-19 20:44:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-19 20:44:31 +0000 |
commit | 72286d61295b0b569d17e3c0fc5a669b82c27e8b (patch) | |
tree | e252019c611946d1d2f59eeeeb6213f90009705a /clang/lib/Lex | |
parent | 561fa8490efe6a654f100b7d9a61decf207f04df (diff) | |
download | bcm5719-llvm-72286d61295b0b569d17e3c0fc5a669b82c27e8b.tar.gz bcm5719-llvm-72286d61295b0b569d17e3c0fc5a669b82c27e8b.zip |
add a PPCallback handler for a skipped #include, patch by
Zhanyong Wan!
llvm-svn: 101813
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 8033e475c8c..eb8664585f3 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1088,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. @@ -1100,6 +1095,15 @@ 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); @@ -1667,4 +1671,3 @@ void Preprocessor::HandleElifDirective(Token &ElifToken) { return SkipExcludedConditionalBlock(CI.IfLoc, /*Foundnonskip*/true, /*FoundElse*/CI.FoundElse); } - |