aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-27 19:58:08 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-27 19:58:08 +0000
commite81e24c84bae6d5a999d9e34a21c4ec73f91d37e (patch)
treee04270645d456f9b47b39e058ffc5738cd0f9631
parent71ac846a4e20ad378700df040abeb3eb06163bca (diff)
Implemented serialization of FunctionTypeNoProto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--AST/TypeSerialization.cpp19
-rw-r--r--include/clang/AST/Type.h7
2 files changed, 26 insertions, 0 deletions
diff --git a/AST/TypeSerialization.cpp b/AST/TypeSerialization.cpp
index 0ffdb99f83..efd6e76389 100644
--- a/AST/TypeSerialization.cpp
+++ b/AST/TypeSerialization.cpp
@@ -153,3 +153,22 @@ VectorType* VectorType::Materialize(llvm::Deserializer& D) {
T->NumElements = D.ReadInt();
return T;
}
+
+void FunctionType::EmitFunctionTypeInternal(llvm::Serializer &S) const {
+ EmitTypeInternal(S);
+ S.EmitBool(SubClassData);
+ S.Emit(ResultType);
+}
+
+void FunctionType::ReadFunctionTypeInternal(llvm::Deserializer& D) {
+ ReadTypeInternal(D);
+ SubClassData = D.ReadBool();
+ D.Read(ResultType);
+}
+
+
+FunctionTypeNoProto* FunctionTypeNoProto::Materialize(llvm::Deserializer& D) {
+ FunctionTypeNoProto* T = new FunctionTypeNoProto(QualType(),QualType());
+ T->ReadFunctionTypeInternal(D);
+ return T;
+}
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index cc4d544f52..c8ee202d1c 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -711,6 +711,10 @@ public:
T->getTypeClass() == FunctionProto;
}
static bool classof(const FunctionType *) { return true; }
+
+protected:
+ void EmitFunctionTypeInternal(llvm::Serializer& S) const;
+ void ReadFunctionTypeInternal(llvm::Deserializer& D);
};
/// FunctionTypeNoProto - Represents a K&R-style 'int foo()' function, which has
@@ -735,6 +739,9 @@ public:
return T->getTypeClass() == FunctionNoProto;
}
static bool classof(const FunctionTypeNoProto *) { return true; }
+
+ void Emit(llvm::Serializer& S) const { EmitFunctionTypeInternal(S); }
+ static FunctionTypeNoProto* Materialize(llvm::Deserializer& D);
};
/// FunctionTypeProto - Represents a prototype with argument type info, e.g.