]> granicus.if.org Git - clang/commitdiff
Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 13 Dec 2007 00:54:18 +0000 (00:54 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 13 Dec 2007 00:54:18 +0000 (00:54 +0000)
Ted, this change necessitates (de)/serialization of ParmVarDecl.

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

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

index 16654bbe665584d7548ed5cd29a715b870f910d3..f2ed75b4b56b257daf092d84dbd59b940956d9df 100644 (file)
@@ -146,13 +146,15 @@ void ValueDecl::ReadInRec(Deserializer& D) {
 void VarDecl::EmitInRec(Serializer& S) const {
   ValueDecl::EmitInRec(S);
   S.EmitInt(getStorageClass());             // From VarDecl.
-  S.EmitInt(getObjcDeclQualifier());        // 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.  
-  objcDeclQualifier = static_cast<ObjcDeclQualifier>(D.ReadInt());  // VarDecl.
+  SClass = static_cast<StorageClass>(D.ReadInt());  // From VarDecl. 
+  // FIXME: This is now in ParmVarDecl
+  // objcDeclQualifier = static_cast<ObjcDeclQualifier>(D.ReadInt());  // VarDecl.
 }
 
     //===------------------------------------------------------------===//
index a1bb625dda3c448ca2fcf854b2e3fb0a3bb30f8e..8fd68295fbcd211ea5df0e3e38838c614b54723d 100644 (file)
@@ -319,10 +319,6 @@ public:
   //  as static variables declared within a function.
   bool hasGlobalStorage() const { return !hasAutoStorage(); }
   
-  ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
-  void setObjcDeclQualifier(ObjcDeclQualifier QTVal) 
-    { objcDeclQualifier = QTVal; }
-  
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
     return D->getKind() >= VarFirst && D->getKind() <= VarLast;
@@ -331,16 +327,12 @@ public:
 protected:
   VarDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, QualType T,
           StorageClass SC, ScopedDecl *PrevDecl, AttributeList *A = 0)
-    : ValueDecl(DK, L, Id, T, PrevDecl, A), Init(0), 
-      objcDeclQualifier(OBJC_TQ_None) { SClass = SC; }
+    : ValueDecl(DK, L, Id, T, PrevDecl, A), Init(0) { SClass = SC; }
 private:
   Expr *Init;
   // FIXME: This can be packed into the bitfields in Decl.
   unsigned SClass : 3;
-  /// FIXME: Also can be paced into the bitfields in Decl.
-  /// in, inout, etc.
-  ObjcDeclQualifier objcDeclQualifier : 6;
-  
+    
   friend class StmtIteratorBase;
   
 protected:
@@ -401,12 +393,22 @@ class ParmVarDecl : public VarDecl {
 public:
   ParmVarDecl(SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S,
               ScopedDecl *PrevDecl, AttributeList *A = 0)
-    : VarDecl(ParmVar, L, Id, T, S, PrevDecl, A) {}
+    : VarDecl(ParmVar, L, Id, T, S, PrevDecl, A), 
+    objcDeclQualifier(OBJC_TQ_None) {}
   
+  ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
+  void setObjcDeclQualifier(ObjcDeclQualifier QTVal) 
+  { objcDeclQualifier = QTVal; }
+    
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == ParmVar; }
   static bool classof(const ParmVarDecl *D) { return true; }
   
+private:
+  /// FIXME: Also can be paced into the bitfields in Decl.
+  /// in, inout, etc.
+  ObjcDeclQualifier objcDeclQualifier : 6;
+  
 protected:
   /// CreateImpl - Deserialize a ParmVarDecl.  Called by Decl::Create.
   static ParmVarDecl* CreateImpl(llvm::Deserializer& D);