[cfe-commits] [PATCH] ObjC: interface decls pointing to implementation decls

Argyrios Kyrtzidis kyrtzidis at apple.com
Sun Jul 19 18:21:00 PDT 2009


Oops, forgot to attach the patches before.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc_impl1.patch
Type: application/octet-stream
Size: 5456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090719/da6703c3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc_impl2.patch
Type: application/octet-stream
Size: 5877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090719/da6703c3/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc_impl3.patch
Type: application/octet-stream
Size: 11098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090719/da6703c3/attachment-0002.obj>
-------------- next part --------------


On Jul 19, 2009, at 6:19 PM, Argyrios Kyrtzidis wrote:

> Hi all,
>
> Currently you can't find the implementation of an interface using only
> the ASTContext. This results in Sema doing name lookups when looking
> for methods or keeping data structures like ObjCCategoryImpls.
> IMO the ASTContext should provide the information that "this
> ObjCIntefaceDecl is implemented by this ObjCImplementationDecl". This
> way Sema gets simplified, it can get at the implementation without
> doing name lookups
> and a client can easily access such information without the need to
> build data structures like Sema's.
>
> I attached 3 patches for your reviewal pleasure:
>
> objc_impl1.patch:  Modifies ObjCContainerDecl so that it can point to
> its implementation. As a bonus, Sema is modified to emit an error when
> a category is reimplemented (previously it didn't emit any  
> diagnostic).
> objc_impl2.patch:  Sema::LookupObjCImplementation() is removed, and
> ObjCInterfaceDecl::getImplementation() is used in its place. No name
> lookups, w00t!
> objc_impl3.patch: The ObjCCategoryImpls vector is removed from Sema,
> and ObjCInterfaceDecl::getCategoryClassMethod() and
> ObjCInterfaceDecl::getCategoryInstanceMethod() are used for the same
> functionality.
>
> Let me know what you think.
>
> -Argiris
> _______________________________________________
> 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