From: Douglas Gregor Date: Wed, 27 Jul 2011 16:30:06 +0000 (+0000) Subject: Modules don't require validation of the predefines buffer X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7d445a718906820bf275fbfaedce269a407a6c5;p=clang Modules don't require validation of the predefines buffer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136224 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 3994fe6b7b..b377be6267 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -2560,7 +2560,7 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, PreloadSLocEntries.clear(); // Check the predefines buffers. - if (!DisableValidation && CheckPredefinesBuffers()) + if (!DisableValidation && Type != MK_Module && CheckPredefinesBuffers()) return IgnorePCH; if (PP) { @@ -2576,6 +2576,11 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, // since de-serializing declarations or macro definitions can add // new entries into the identifier table, invalidating the // iterators. + // + // FIXME: We need a lazier way to load this information, e.g., by marking + // the identifier data as 'dirty', so that it will be looked up in the + // AST file(s) if it is uttered in the source. This could save us some + // module load time. SmallVector Identifiers; for (IdentifierTable::iterator Id = PP->getIdentifierTable().begin(), IdEnd = PP->getIdentifierTable().end();