[cfe-commits] r44972 - in /cfe/trunk: AST/DeclSerialization.cpp include/clang/AST/Decl.h

Fariborz Jahanian fjahanian at apple.com
Wed Dec 12 16:54:18 PST 2007


Author: fjahanian
Date: Wed Dec 12 18:54:18 2007
New Revision: 44972

URL: http://llvm.org/viewvc/llvm-project?rev=44972&view=rev
Log:
Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Ted, this change necessitates (de)/serialization of ParmVarDecl.


Modified:
    cfe/trunk/AST/DeclSerialization.cpp
    cfe/trunk/include/clang/AST/Decl.h

Modified: cfe/trunk/AST/DeclSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/DeclSerialization.cpp?rev=44972&r1=44971&r2=44972&view=diff

==============================================================================
--- cfe/trunk/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/AST/DeclSerialization.cpp Wed Dec 12 18:54:18 2007
@@ -146,13 +146,15 @@
 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.
 }
 
     //===------------------------------------------------------------===//

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

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Wed Dec 12 18:54:18 2007
@@ -319,10 +319,6 @@
   //  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 @@
 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 @@
 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);





More information about the cfe-commits mailing list