]> granicus.if.org Git - clang/commitdiff
Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.
authorTed Kremenek <kremenek@apple.com>
Thu, 13 Dec 2007 06:28:13 +0000 (06:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 13 Dec 2007 06:28:13 +0000 (06:28 +0000)
Previously this field was serialized out in VarDecl (a parent class), but
now the field belongs to ParmVarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44989 91177308-0d34-0410-b5e6-96231b3b80d8

AST/DeclSerialization.cpp
include/clang/AST/Decl.h

index f2ed75b4b56b257daf092d84dbd59b940956d9df..cc29210f4fe351879224f653535eeb9391e6d63f 100644 (file)
@@ -146,15 +146,11 @@ void ValueDecl::ReadInRec(Deserializer& D) {
 void VarDecl::EmitInRec(Serializer& S) const {
   ValueDecl::EmitInRec(S);
   S.EmitInt(getStorageClass());             // From VarDecl.
-  // FIXME: This is now in ParmVarDecl
-  // S.EmitInt(getObjcDeclQualifier());        // From VarDecl.
 }
 
 void VarDecl::ReadInRec(Deserializer& D) {
   ValueDecl::ReadInRec(D);
   SClass = static_cast<StorageClass>(D.ReadInt());  // From VarDecl. 
-  // FIXME: This is now in ParmVarDecl
-  // objcDeclQualifier = static_cast<ObjcDeclQualifier>(D.ReadInt());  // VarDecl.
 }
 
     //===------------------------------------------------------------===//
@@ -219,12 +215,18 @@ FileVarDecl* FileVarDecl::CreateImpl(Deserializer& D) {
 //      ParmDecl Serialization.
 //===----------------------------------------------------------------------===//
 
+void ParmVarDecl::EmitImpl(llvm::Serializer& S) const {
+  VarDecl::EmitImpl(S);
+  S.EmitInt(getObjcDeclQualifier());        // From ParmVarDecl.
+}
+
 ParmVarDecl* ParmVarDecl::CreateImpl(Deserializer& D) {
   ParmVarDecl* decl =
     new ParmVarDecl(SourceLocation(),NULL,QualType(),None,NULL);
   
   decl->VarDecl::ReadImpl(D);
-  
+  decl->objcDeclQualifier = static_cast<ObjcDeclQualifier>(D.ReadInt());
+
   return decl;
 }
 
index 8fd68295fbcd211ea5df0e3e38838c614b54723d..efa79d5372fb26c13bdd407e2c30812aeceef639 100644 (file)
@@ -410,6 +410,9 @@ private:
   ObjcDeclQualifier objcDeclQualifier : 6;
   
 protected:
+  /// EmitImpl - Serialize this ParmVarDecl. Called by Decl::Emit.
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  
   /// CreateImpl - Deserialize a ParmVarDecl.  Called by Decl::Create.
   static ParmVarDecl* CreateImpl(llvm::Deserializer& D);