]> granicus.if.org Git - clang/commitdiff
Implemented serialization of FunctionTypeNoProto.
authorTed Kremenek <kremenek@apple.com>
Sat, 27 Oct 2007 19:58:08 +0000 (19:58 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 27 Oct 2007 19:58:08 +0000 (19:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8

AST/TypeSerialization.cpp
include/clang/AST/Type.h

index 0ffdb99f83f420ce2ebf0146564192ab78bab90c..efd6e763899b97111c5f1bb8a3ba9d15baf17a1b 100644 (file)
@@ -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;
+}
index cc4d544f524b17908ac879744331f3e18953717a..c8ee202d1c05ff293c14d94929cf5f532e8da682 100644 (file)
@@ -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.