]> granicus.if.org Git - clang/commitdiff
Modules don't require validation of the predefines buffer
authorDouglas Gregor <dgregor@apple.com>
Wed, 27 Jul 2011 16:30:06 +0000 (16:30 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 27 Jul 2011 16:30:06 +0000 (16:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136224 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp

index 3994fe6b7b145e527d4efce7f9553b21d5c7541b..b377be6267e2357bedd96162b641460892bc72a1 100644 (file)
@@ -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<IdentifierInfo *, 128> Identifiers;
     for (IdentifierTable::iterator Id = PP->getIdentifierTable().begin(),
                                 IdEnd = PP->getIdentifierTable().end();