summaryrefslogtreecommitdiffstats
path: root/clang/AST/DeclSerialization.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-14 22:51:02 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-14 22:51:02 +0000
commit83b75f5ee8e55d9cd3fbe1c1e887766201c70d1b (patch)
treee71508256d19477e6af3c6cc8f8baf8911252fba /clang/AST/DeclSerialization.cpp
parentc6225532c34ab872ed02d68ed5b4c43c6ea92509 (diff)
downloadbcm5719-llvm-83b75f5ee8e55d9cd3fbe1c1e887766201c70d1b.tar.gz
bcm5719-llvm-83b75f5ee8e55d9cd3fbe1c1e887766201c70d1b.zip
Added QualType::ReadBackpatch to allow QualType initialization with
backpatching. This original was available, but then we removed it. It is back again to help with deserialization of FieldDecls. Because FieldDecls are currently owned by RecordDecls, which are owned by a TagType, the type of the FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus backpatching solves the problem of constructing a FieldDecl that references a type that has not yet been deserialized. Simplified serialization of TagType to not require passing in the SerializedPtrID. Registration of the materialized type object is done after the CreateImpl method returns (as with other types). llvm-svn: 44143
Diffstat (limited to 'clang/AST/DeclSerialization.cpp')
-rw-r--r--clang/AST/DeclSerialization.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/AST/DeclSerialization.cpp b/clang/AST/DeclSerialization.cpp
index 555c33edf68..208e81ca0f9 100644
--- a/clang/AST/DeclSerialization.cpp
+++ b/clang/AST/DeclSerialization.cpp
@@ -295,8 +295,8 @@ void FieldDecl::EmitImpl(Serializer& S) const {
}
FieldDecl* FieldDecl::CreateImpl(Deserializer& D) {
- QualType DeclType = QualType::ReadVal(D);
- FieldDecl* decl = new FieldDecl(SourceLocation(),NULL,DeclType);
+ FieldDecl* decl = new FieldDecl(SourceLocation(),NULL,QualType());
+ decl->DeclType.ReadBackpatch(D);
decl->ReadInRec(D);
decl->BitWidth = D.ReadOwnedPtr<Expr>();
return decl;
OpenPOWER on IntegriCloud