[cfe-commits] [PATCH] ObjC: interface decls pointing to implementation decls
kyrtzidis at apple.com
Sun Jul 19 18:19:14 PDT 2009
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
objc_impl3.patch: The ObjCCategoryImpls vector is removed from Sema,
and ObjCInterfaceDecl::getCategoryClassMethod() and
ObjCInterfaceDecl::getCategoryInstanceMethod() are used for the same
Let me know what you think.
More information about the cfe-commits