Author: dgregor
Date: Fri Sep  9 16:09:37 2011
New Revision: 139409

URL: http://llvm.org/viewvc/llvm-project?rev=139409&view=rev
Log:
Mark the translation unit as having lexical/visible storage only when we 
actually have data for that lexical or visible storage

Modified:
    cfe/trunk/lib/Serialization/ASTReader.cpp

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=139409&r1=139408&r2=139409&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Sep  9 16:09:37 2011
@@ -2817,6 +2817,11 @@
       DeclContextInfo Info = DCU->second;
       (*M)->DeclContextInfos.erase(DCU);
       (*M)->DeclContextInfos[TU] = Info;
+      
+      if (Info.NumLexicalDecls)
+        TU->setHasExternalLexicalStorage();
+      if (Info.NameLookupTableData)
+        TU->setHasExternalVisibleStorage();
     }
   }
   
@@ -2828,10 +2833,6 @@
   // if there are any.
   loadDeclUpdateRecords(PREDEF_DECL_TRANSLATION_UNIT_ID, TU);
   
-  // Note that the translation unit has external lexical and visible storage.
-  TU->setHasExternalLexicalStorage(true);
-  TU->setHasExternalVisibleStorage(true);
-
   // FIXME: Find a better way to deal with collisions between these
   // built-in types. Right now, we just ignore the problem.
   


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to