diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-09 21:09:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-09 21:09:37 +0000 |
commit | 5db255e02fde04cbfec65e4596a217591933a76b (patch) | |
tree | a07e8d027c482760d4661b32cfe495f51a8f16c5 /lib/Serialization | |
parent | 5181ad023c32f4f13a842e41ed7f8e3c2e23a38e (diff) |
Mark the translation unit as having lexical/visible storage only when we actually have data for that lexical or visible storage
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index e574e25f5b..55dd213286 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -2817,6 +2817,11 @@ void ASTReader::InitializeContext(ASTContext &Ctx) { 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 @@ void ASTReader::InitializeContext(ASTContext &Ctx) { // 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. |