summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-01 18:11:32 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-01 18:11:32 +0000
commit26a7f3fd5621a757a1105be94a07979ec03ff816 (patch)
tree967007d0f871b49dc6a2bed4b586a8178f4847c3
parentac73ff8868268550fb28f5d7e7beb510dcfb6f6b (diff)
downloadbcm5719-llvm-26a7f3fd5621a757a1105be94a07979ec03ff816.tar.gz
bcm5719-llvm-26a7f3fd5621a757a1105be94a07979ec03ff816.zip
Implemented serialization of QualTypes within ASTContext. Clarified
ownership model of some type pointers. Added FIXMEs to serialization. Added comments to ASTContext indicating which variables we are intentionally *not* serializing. llvm-svn: 43618
-rw-r--r--clang/AST/ASTContext.cpp23
-rw-r--r--clang/include/clang/AST/ASTContext.h7
2 files changed, 28 insertions, 2 deletions
diff --git a/clang/AST/ASTContext.cpp b/clang/AST/ASTContext.cpp
index acba398fb3e..3ebc1af0cd8 100644
--- a/clang/AST/ASTContext.cpp
+++ b/clang/AST/ASTContext.cpp
@@ -1419,9 +1419,17 @@ void ASTContext::Emit(llvm::Serializer& S) const {
EmitSet(VectorTypes,S);
EmitSet(FunctionTypeNoProtos,S);
EmitSet(FunctionTypeProtos,S);
-
// FIXME: EmitSet(ObjcQualifiedInterfaceTypes,S);
- // FIXME: RecourdLayoutInfo
+
+ S.Emit(BuiltinVaListType);
+ S.Emit(ObjcIdType);
+ S.EmitPtr(IdStructType);
+ S.Emit(ObjcProtoType);
+ S.EmitPtr(ProtoStructType);
+ S.Emit(ObjcClassType);
+ S.EmitPtr(ClassStructType);
+ S.Emit(ObjcConstantStringType);
+ // FIXME: S.EmitOwnedPtr(CFConstantStringTypeDecl);
}
ASTContext* ASTContext::Materialize(llvm::Deserializer& D) {
@@ -1466,6 +1474,17 @@ ASTContext* ASTContext::Materialize(llvm::Deserializer& D) {
ReadSet(A->VectorTypes, A->Types, D);
ReadSet(A->FunctionTypeNoProtos, A->Types, D);
ReadSet(A->FunctionTypeProtos, A->Types, D);
+ // ReadSet(A->ObjcQualifiedInterfaceTypes,D);
+
+ D.Read(A->BuiltinVaListType);
+ D.Read(A->ObjcIdType);
+ D.ReadPtr(A->IdStructType);
+ D.Read(A->ObjcProtoType);
+ D.ReadPtr(A->ProtoStructType);
+ D.Read(A->ObjcClassType);
+ D.ReadPtr(A->ClassStructType);
+ D.Read(A->ObjcConstantStringType);
+ // FIXME: A->CFConstantStringTypeDecl = D.ReadOwnedPtr<RecordDecl>();
return A;
}
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index d8dc9d49928..e236f2a56b6 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -42,6 +42,9 @@ class ASTContext {
llvm::FoldingSet<FunctionTypeNoProto> FunctionTypeNoProtos;
llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos;
llvm::FoldingSet<ObjcQualifiedInterfaceType> ObjcQualifiedInterfaceTypes;
+
+ /// RecordLayoutInfo - A cache mapping from RecordDecls to RecordLayoutInfo.
+ /// This is lazily created. This is intentionally not serialized.
llvm::DenseMap<const RecordDecl*, const RecordLayout*> RecordLayoutInfo;
/// BuiltinVaListType - built-in va list type.
@@ -73,6 +76,10 @@ public:
TargetInfo &Target;
IdentifierTable &Idents;
SelectorTable &Selectors;
+
+ /// This is intentionally not serialized. It is populated by the
+ /// ASTContext ctor, and there are no external pointers/references to
+ /// internal variables of BuiltinInfo.
Builtin::Context BuiltinInfo;
// Builtin Types.
OpenPOWER on IntegriCloud