[cfe-commits] r69621 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Devang Patel
devang.patel at gmail.com
Mon Apr 20 14:31:14 PDT 2009
On Mon, Apr 20, 2009 at 1:18 PM, Daniel Dunbar <daniel at zuster.org> wrote:
>
> +/// countInheritedIvars - count number of ivars in class and its super class(s)
> +///
> +static int countInheritedIvars(const ObjCInterfaceDecl *OI,
> + ASTContext &Context) {
> + int count = 0;
> + if (!OI)
> + return 0;
> + const ObjCInterfaceDecl *SuperClass = OI->getSuperClass();
> + if (SuperClass)
> + count += countInheritedIvars(SuperClass, Context);
> + for (ObjCInterfaceDecl::ivar_iterator I = OI->ivar_begin(),
> + E = OI->ivar_end(); I != E; ++I)
> + ++count;
nit-pick. The name countInheritedIvars, suggests that this routine
only counts ivars that are inherited.
-
Devang
More information about the cfe-commits
mailing list