PATCH: private ivars

Dmitri Gribenko gribozavr at gmail.com
Fri Feb 15 15:59:16 PST 2013


On Sat, Feb 16, 2013 at 1:45 AM, Adrian Prantl <aprantl at apple.com> wrote:
>
> On Feb 15, 2013, at 3:06 PM, jahanian <fjahanian at apple.com> wrote:
>
>> ObjCInterfaceDecl::all_declared_ivar_begin has changed recently. You need to apply the patch against
>> current revision and make sure all clang tests pass after that.
>
> Thanks for noticing, Fariborz! Here is a rebased patch that passes the regression suite.

Sorry, there's one more:

+    ObjCInterfaceDecl* decl = cast<ObjCInterfaceType>(Ty)->getDecl();
+    if (decl)

cast<> can not return null (it will either succeed or assert in
+Asserts mode, or just produce a wrong value in -Asserts).  Use
dyn_cast (that returns null on failure) or drop the check -- whatever
is appropriate.  And there's a dyn_cast idiom:

if (Foo *F = dyn_cast<Foo>(Blah))
  ... use F...

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list