]> granicus.if.org Git - clang/commitdiff
Added new type and bitfield fields in some decl types in preparation for objective...
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 31 Oct 2007 00:12:35 +0000 (00:12 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 31 Oct 2007 00:12:35 +0000 (00:12 +0000)
Added initialization of Class/SEMA types.

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

Sema/SemaDecl.cpp
clang.xcodeproj/project.pbxproj
include/clang/AST/Decl.h
include/clang/AST/DeclObjC.h

index 4f59fe12789ad44b1a515f1e2fce420a9ac14b74..861c31e0d717b69260402751836ff8c7794bf283 100644 (file)
@@ -1201,6 +1201,8 @@ Sema::DeclTy *Sema::ActOnStartCategoryImplementation(
   // somewhere else. At this time, this is a good enough place to do type
   // encoding of methods and ivars for the rewrite client.
   GetObjcIdType(AtCatImplLoc);
+  // GetObjcClassType(AtCatImplLoc); NYI
+  GetObjcSelType(AtCatImplLoc);
   
   /// TODO: Check that CatName, category name, is not used in another
   // implementation.
@@ -1278,6 +1280,8 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
   // somewhere else. At this time, this is a good enough place to do type
   // encoding of methods and ivars for the rewrite client.
   GetObjcIdType(AtClassImplLoc);
+  // GetObjcClassType(AtClassImplLoc); NYI
+  GetObjcSelType(AtClassImplLoc);
   
   return IMPDecl;
 }
index de41b4628d0c47ae944965792f26798c623eb63f..fe4cf8d85be8296188b8454e3723b21a50eb5906 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
                        projectDirPath = "";
index 923ea8a11bc20294fc5f03e8ec3baab696d89f47..0ed304cab77746a45abf4ffaada08d6fd1b37e72 100644 (file)
@@ -98,6 +98,19 @@ public:
     IDNS_Ordinary
   };
   
+  /// ObjcDeclQualifier - Qualifier used on types in method declarations
+  /// for remote messaging. They are meant for the arguments though and
+  /// applied to the Decls (ObjcMethodDecl and ParmVarDecl).
+  enum ObjcDeclQualifier {
+    OBJC_TQ_None = 0x0,
+    OBJC_TQ_In = 0x1,
+    OBJC_TQ_Inout = 0x2,
+    OBJC_TQ_Out = 0x4,
+    OBJC_TQ_Bycopy = 0x8,
+    OBJC_TQ_Byref = 0x10,
+    OBJC_TQ_Oneway = 0x20
+  };
+    
 private:
   /// Loc - The location that this decl.
   SourceLocation Loc;
@@ -280,6 +293,8 @@ public:
   //  as static variables declared within a function.
   bool hasGlobalStorage() const { return !hasAutoStorage(); }
   
+  ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
+  
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
     return D->getKind() >= VarFirst && D->getKind() <= VarLast;
@@ -288,11 +303,16 @@ public:
 protected:
   VarDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, QualType T,
           StorageClass SC, ScopedDecl *PrevDecl)
-    : ValueDecl(DK, L, Id, T, PrevDecl), Init(0) { SClass = SC; }
+    : ValueDecl(DK, L, Id, T, PrevDecl), Init(0), 
+      objcDeclQualifier(OBJC_TQ_None) { 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;
 };
 
index 9cc9e5ae49e3670b5cc8bd339f5c2f8d010bdeff..0ca98bb6eca7f12ba56f783706665f5e9a353e9b 100644 (file)
@@ -218,6 +218,9 @@ private:
   /// @required/@optional
   ImplementationControl DeclImplementation : 2;
   
+  /// in, inout, etc.
+  ObjcDeclQualifier objcDeclQualifier : 6;
+  
   // A unigue name for this method.
   Selector SelName;
   
@@ -241,11 +244,14 @@ public:
                  Decl *PrevDecl = 0)
     : Decl(ObjcMethod, beginLoc),
       IsInstance(isInstance), DeclImplementation(impControl),
+      objcDeclQualifier(OBJC_TQ_None),
       SelName(SelInfo), MethodDeclType(T), 
       ParamInfo(paramInfo), NumMethodParams(numParams),
       MethodAttrs(M), EndLoc(endLoc) {}
   virtual ~ObjcMethodDecl();
   
+  ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
+  
   // Location information, modeled after the Stmt API.
   SourceLocation getLocStart() const { return getLocation(); }
   SourceLocation getLocEnd() const { return EndLoc; }