OK for now. But I need to investigate why lookupFieldDeclForIvar is getting called in this case of method having the same name as an 'ivar'.
- Fariborz On Dec 17, 2008, at 6:14 AM, Steve Naroff wrote: > Author: snaroff > Date: Wed Dec 17 08:13:49 2008 > New Revision: 61134 > > URL: http://llvm.org/viewvc/llvm-project?rev=61134&view=rev > Log: > Fix <rdar://problem/6450964> clang on xcode: Assertion failed: > (RecordForDecl && "lookupFieldDeclForIvar no storage for class"). > > This was a recent regression caused by r61043 (related to code gen. > for ivar references). > > Fariborz, please review. I have some other concerns related to code > generation for ivars that we can discuss later. > > Added: > cfe/trunk/test/SemaObjC/interface-layout-2.m > Modified: > cfe/trunk/lib/AST/DeclObjC.cpp > > Modified: cfe/trunk/lib/AST/DeclObjC.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=61134&r1=61133&r2=61134&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/lib/AST/DeclObjC.cpp (original) > +++ cfe/trunk/lib/AST/DeclObjC.cpp Wed Dec 17 08:13:49 2008 > @@ -369,6 +369,8 @@ > /// > FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext > &Context, > const > ObjCIvarDecl *ivar) { > + if (!RecordForDecl) > + addRecordToClass(Context); > assert(RecordForDecl && "lookupFieldDeclForIvar no storage for > class"); > DeclarationName Member = ivar->getDeclName(); > DeclContext::lookup_result Lookup = RecordForDecl->lookup(Context, > Member); > > Added: cfe/trunk/test/SemaObjC/interface-layout-2.m > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/interface-layout-2.m?rev=61134&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/test/SemaObjC/interface-layout-2.m (added) > +++ cfe/trunk/test/SemaObjC/interface-layout-2.m Wed Dec 17 08:13:49 > 2008 > @@ -0,0 +1,16 @@ > +// RUN: clang %s -fsyntax-only -verify > +...@interface A > +{ > + int ivar; > +} > +...@end > + > +...@interface B : A > +- (int)ivar; > +...@end > + > +...@implementation B > +- (int)ivar { > + return ivar; > +} > +...@end > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
