diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-22 22:18:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-22 22:18:58 +0000 |
commit | acfc76cc636f2dc46c921a4c7fa41d51d8bf447d (patch) | |
tree | e20b9eefa3c217685c6ea9b4e44c31808a0b08e1 /clang/lib/Frontend/PCHReader.cpp | |
parent | f00919a040917799b619e5f00c4d586c9f3db108 (diff) | |
download | bcm5719-llvm-acfc76cc636f2dc46c921a4c7fa41d51d8bf447d.tar.gz bcm5719-llvm-acfc76cc636f2dc46c921a4c7fa41d51d8bf447d.zip |
Support locally-declared external declarations in PCH files
llvm-svn: 69833
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 28cca4d0ff2..66a849d5761 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/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) { |