[cfe-commits] r43418 - in /cfe/trunk: AST/TypeSerialization.cpp include/clang/AST/Type.h

Ted Kremenek kremenek at apple.com
Sat Oct 27 12:58:09 PDT 2007


Author: kremenek
Date: Sat Oct 27 14:58:08 2007
New Revision: 43418

URL: http://llvm.org/viewvc/llvm-project?rev=43418&view=rev
Log:
Implemented serialization of FunctionTypeNoProto.

Modified:
    cfe/trunk/AST/TypeSerialization.cpp
    cfe/trunk/include/clang/AST/Type.h

Modified: cfe/trunk/AST/TypeSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/TypeSerialization.cpp?rev=43418&r1=43417&r2=43418&view=diff

==============================================================================
--- cfe/trunk/AST/TypeSerialization.cpp (original)
+++ cfe/trunk/AST/TypeSerialization.cpp Sat Oct 27 14:58:08 2007
@@ -153,3 +153,22 @@
   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;
+}

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=43418&r1=43417&r2=43418&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Sat Oct 27 14:58:08 2007
@@ -711,6 +711,10 @@
            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 @@
     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.





More information about the cfe-commits mailing list