diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-01 02:29:35 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-01 02:29:35 +0000 |
commit | 2aedca340c84eafdc7285eb68145e55213324185 (patch) | |
tree | a5f7498611c5aa78996d2f9cad700e04aa8f93a0 /clang/lib | |
parent | 8fabc1b47d0237f363c1a34dc5de744973c74891 (diff) | |
download | bcm5719-llvm-2aedca340c84eafdc7285eb68145e55213324185.tar.gz bcm5719-llvm-2aedca340c84eafdc7285eb68145e55213324185.zip |
[modules] Before checking whether the controlling macro of a header is defined,
update the identifier in case we've imported a definition of the macro (and
thus the contents of the header) from a module.
Also fold ExternalIdentifierLookup into ExternalPreprocessorSource; it no longer
makes sense to keep these separate now that the only user of the former also
needs the latter.
llvm-svn: 241137
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 40b28222b8b..36fba994f1e 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -71,8 +71,6 @@ IdentifierIterator *IdentifierInfoLookup::getIdentifiers() { return new EmptyLookupIterator(); } -ExternalIdentifierLookup::~ExternalIdentifierLookup() {} - IdentifierTable::IdentifierTable(const LangOptions &LangOpts, IdentifierInfoLookup* externalLookup) : HashTable(8192), // Start with space for 8K identifiers. diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 67a00586a64..89120ff84d9 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -14,6 +14,7 @@ #include "clang/Lex/HeaderSearch.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/IdentifierTable.h" +#include "clang/Lex/ExternalPreprocessorSource.h" #include "clang/Lex/HeaderMap.h" #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/LexDiagnostic.h" @@ -33,9 +34,13 @@ using namespace clang; const IdentifierInfo * -HeaderFileInfo::getControllingMacro(ExternalIdentifierLookup *External) { - if (ControllingMacro) +HeaderFileInfo::getControllingMacro(ExternalPreprocessorSource *External) { + if (ControllingMacro) { + if (ControllingMacro->isOutOfDate()) + External->updateOutOfDateIdentifier( + *const_cast<IdentifierInfo *>(ControllingMacro)); return ControllingMacro; + } if (!ControllingMacroID || !External) return nullptr; |