summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-02 07:14:54 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-02 07:14:54 +0000
commit2d68810caf26d40833abec26c1e6455669014147 (patch)
treeedd8cbef39150b0f2088297f516a43ed87f786b7 /clang/lib/Frontend/PCHReader.cpp
parent4f8e17379d77b14ed0ca90d241d231f5c5457ed6 (diff)
downloadbcm5719-llvm-2d68810caf26d40833abec26c1e6455669014147.tar.gz
bcm5719-llvm-2d68810caf26d40833abec26c1e6455669014147.zip
Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.
llvm-svn: 110031
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 5a239e4f045..0502e674a9d 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -1728,6 +1728,14 @@ PCHReader::ReadPCHBlock(PerFileData &F) {
DynamicClasses.swap(Record);
break;
+ case pch::SEMA_DECL_REFS:
+ if (!SemaDeclRefs.empty()) {
+ Error("duplicate SEMA_DECL_REFS record in PCH file");
+ return Failure;
+ }
+ SemaDeclRefs.swap(Record);
+ break;
+
case pch::ORIGINAL_FILE_NAME:
// The primary PCH will be the last to get here, so it will be the one
// that's used.
@@ -3152,6 +3160,14 @@ void PCHReader::InitializeSema(Sema &S) {
SemaObj->DynamicClasses.push_back(
cast<CXXRecordDecl>(GetDecl(DynamicClasses[I])));
+ // Load the offsets of the declarations that Sema references.
+ // They will be lazily deserialized when needed.
+ if (!SemaDeclRefs.empty()) {
+ assert(SemaDeclRefs.size() == 2 && "More decl refs than expected!");
+ SemaObj->StdNamespace = SemaDeclRefs[0];
+ SemaObj->StdBadAlloc = SemaDeclRefs[1];
+ }
+
// If there are @selector references added them to its pool. This is for
// implementation of -Wselector.
PerFileData &F = *Chain[0];
OpenPOWER on IntegriCloud