diff options
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 28cca4d0ff..66a849d576 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1720,6 +1720,14 @@ PCHReader::ReadPCHBlock(uint64_t &PreprocessorBlockOffset) { } TentativeDefinitions.swap(Record); break; + + case pch::LOCALLY_SCOPED_EXTERNAL_DECLS: + if (!LocallyScopedExternalDecls.empty()) { + Error("Duplicate LOCALLY_SCOPED_EXTERNAL_DECLS record in PCH file"); + return Failure; + } + LocallyScopedExternalDecls.swap(Record); + break; } } @@ -2537,6 +2545,14 @@ void PCHReader::InitializeSema(Sema &S) { VarDecl *Var = cast<VarDecl>(GetDecl(TentativeDefinitions[I])); SemaObj->TentativeDefinitions[Var->getDeclName()] = Var; } + + // If there were any locally-scoped external declarations, + // deserialize them and add them to Sema's table of locally-scoped + // external declarations. + for (unsigned I = 0, N = LocallyScopedExternalDecls.size(); I != N; ++I) { + NamedDecl *D = cast<NamedDecl>(GetDecl(LocallyScopedExternalDecls[I])); + SemaObj->LocallyScopedExternalDecls[D->getDeclName()] = D; + } } IdentifierInfo* PCHReader::get(const char *NameStart, const char *NameEnd) { |