[cfe-commits] r61134 - in /cfe/trunk: lib/AST/DeclObjC.cpp test/SemaObjC/interface-layout-2.m
Fariborz Jahanian
fjahanian at apple.com
Wed Dec 17 09:04:39 PST 2008
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
> + at interface A
> +{
> + int ivar;
> +}
> + at end
> +
> + at interface B : A
> +- (int)ivar;
> + at end
> +
> + at implementation B
> +- (int)ivar {
> + return ivar;
> +}
> + at end
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list