static bool classof(const ObjCPropertyDecl *D) { return true; }
};
+/// ObjCPropertyImplDecl - Represents implementation declaration of a property
+/// in a class or category implementation block. For example:
+/// @synthesize prop1 = ivar1;
+///
+class ObjCPropertyImplDecl : public Decl {
+public:
+ enum PropertyImplKind {
+ OBJC_PR_IMPL_None,
+ OBJC_PR_IMPL_SYNTHSIZE,
+ OBJC_PR_IMPL_DYNAMIC
+ };
+private:
+ /// Property declaration being implemented
+ ObjCPropertyDecl *PropertyDecl;
+ PropertyImplKind PropertyImplementation;
+ /// Null for @dynamic. Required for @synthesize.
+ ObjCIvarDecl *PropertyIvarDecl;
+public:
+ ObjCPropertyImplDecl(SourceLocation L)
+ : Decl(ObjCPropertyImpl, L), PropertyDecl(0),
+ PropertyImplementation(OBJC_PR_IMPL_None), PropertyIvarDecl(0) {}
+
+ void setPropertyDecl(ObjCPropertyDecl *property) { PropertyDecl = property; }
+ ObjCPropertyDecl *getPropertyDecl() const { return PropertyDecl; }
+
+ void setImplKind (PropertyImplKind propImplKind)
+ { PropertyImplementation = propImplKind; }
+ PropertyImplKind getPropertyImplementation() const
+ { return PropertyImplementation; }
+
+ void setPropertyIvarDecl(ObjCIvarDecl *ivarDecl)
+ { PropertyIvarDecl = ivarDecl; }
+ ObjCIvarDecl *getPropertyIvarDecl() { return PropertyIvarDecl; }
+
+ static bool classof(const Decl *D) {
+ return D->getKind() == ObjCPropertyImpl;
+ }
+ static bool classof(const ObjCPropertyImplDecl *D) { return true; }
+};
+
} // end namespace clang
#endif
static unsigned nObjCCategoryImpl = 0;
static unsigned nObjCCompatibleAlias = 0;
static unsigned nObjCPropertyDecl = 0;
+static unsigned nObjCPropertyImplDecl = 0;
static unsigned nLinkageSpecDecl = 0;
static unsigned nFileScopeAsmDecl = 0;
nObjCPropertyDecl, (int)sizeof(ObjCPropertyDecl),
int(nObjCPropertyDecl*sizeof(ObjCPropertyDecl)));
+ fprintf(stderr, " %d property implementation decls, %d each (%d bytes)\n",
+ nObjCPropertyImplDecl, (int)sizeof(ObjCPropertyImplDecl),
+ int(nObjCPropertyImplDecl*sizeof(ObjCPropertyImplDecl)));
+
fprintf(stderr, "Total bytes = %d\n",
int(nFuncs*sizeof(FunctionDecl)+
nVars*sizeof(VarDecl)+nParmVars*sizeof(ParmVarDecl)+
nObjCCategoryImpl*sizeof(ObjCCategoryImplDecl)+
nObjCCompatibleAlias*sizeof(ObjCCompatibleAliasDecl)+
nObjCPropertyDecl*sizeof(ObjCPropertyDecl)+
+ nObjCPropertyImplDecl*sizeof(ObjCPropertyImplDecl)+
nLinkageSpecDecl*sizeof(LinkageSpecDecl)+
nFileScopeAsmDecl*sizeof(FileScopeAsmDecl)));
case ObjCCategoryImpl: nObjCCategoryImpl++; break;
case ObjCCompatibleAlias: nObjCCompatibleAlias++; break;
case ObjCProperty: nObjCPropertyDecl++; break;
+ case ObjCPropertyImpl: nObjCPropertyImplDecl++; break;
case LinkageSpec: nLinkageSpecDecl++; break;
case FileScopeAsm: nFileScopeAsmDecl++; break;
}