void RewriteProtocolDecl(ObjCProtocolDecl *Dcl);
void RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *Dcl);
void RewriteMethodDeclaration(ObjCMethodDecl *Method);
- void RewriteProperties(unsigned nProperties, ObjCPropertyDecl **Properties);
+ void RewriteProperty(ObjCPropertyDecl *prop);
void RewriteFunctionDecl(FunctionDecl *FD);
void RewriteObjCQualifiedInterfaceTypes(Decl *Dcl);
void RewriteObjCQualifiedInterfaceTypes(Expr *E);
}
}
-void RewriteObjC::RewriteProperties(unsigned nProperties, ObjCPropertyDecl **Properties)
+void RewriteObjC::RewriteProperty(ObjCPropertyDecl *prop)
{
- for (unsigned i = 0; i < nProperties; i++) {
- ObjCPropertyDecl *Property = Properties[i];
- SourceLocation Loc = Property->getLocation();
-
- ReplaceText(Loc, 0, "// ", 3);
-
- // FIXME: handle properties that are declared across multiple lines.
- }
+ SourceLocation Loc = prop->getLocation();
+
+ ReplaceText(Loc, 0, "// ", 3);
+
+ // FIXME: handle properties that are declared across multiple lines.
}
void RewriteObjC::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) {
}
SynthesizeObjCInternalStruct(ClassDecl, ResultStr);
- RewriteProperties(ClassDecl->getNumPropertyDecl(),
- ClassDecl->getPropertyDecl());
+ for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(),
+ E = ClassDecl->prop_end(); I != E; ++I)
+ RewriteProperty(*I);
for (ObjCInterfaceDecl::instmeth_iterator I = ClassDecl->instmeth_begin(),
E = ClassDecl->instmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
return PropertyDecl+NumPropertyDecl;
}
- ObjCPropertyDecl * const * getPropertyDecl() const { return PropertyDecl; }
- ObjCPropertyDecl **getPropertyDecl() { return PropertyDecl; }
- unsigned getNumPropertyDecl() const { return NumPropertyDecl; }
-
ObjCPropertyDecl *FindPropertyDeclaration(IdentifierInfo *PropertyId) const;
// Iterator access to instance/class methods.
// Get the local instance/class method declared in this interface.
ObjCMethodDecl *getInstanceMethod(Selector Sel) const;
ObjCMethodDecl *getClassMethod(Selector Sel) const;
-
- // Get the number of instance/class methods. These methods are slow, O(n).
+
+ // Get the number of methods, properties. These methods are slow, O(n).
unsigned getNumInstanceMethods() const;
unsigned getNumClassMethods() const;
+ unsigned getNumProperties() const;
// Marks the end of the container.
SourceLocation getAtEndLoc() const { return AtEndLoc; }