From e81e24c84bae6d5a999d9e34a21c4ec73f91d37e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 27 Oct 2007 19:58:08 +0000 Subject: [PATCH] Implemented serialization of FunctionTypeNoProto. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/TypeSerialization.cpp | 19 +++++++++++++++++++ include/clang/AST/Type.h | 7 +++++++ 2 files changed, 26 insertions(+) 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.