diff options
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 3e59cdbd186..04cdb0f69f7 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -18,6 +18,7 @@ #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/LexDiagnostic.h" #include "clang/Lex/Lexer.h" +#include "clang/Lex/Preprocessor.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallString.h" @@ -1016,7 +1017,9 @@ void HeaderSearch::MarkFileModuleHeader(const FileEntry *FE, HFI.setHeaderRole(Role); } -bool HeaderSearch::ShouldEnterIncludeFile(const FileEntry *File, bool isImport){ +bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP, + const FileEntry *File, + bool isImport) { ++NumIncluded; // Count # of attempted #includes. // Get information about this file. @@ -1041,7 +1044,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(const FileEntry *File, bool isImport){ // if the macro that guards it is defined, we know the #include has no effect. if (const IdentifierInfo *ControllingMacro = FileInfo.getControllingMacro(ExternalLookup)) - if (ControllingMacro->hasMacroDefinition()) { + if (PP.isMacroDefined(ControllingMacro)) { ++NumMultiIncludeFileOptzn; return false; } |