[PATCH] D34494: fix determination of whether declarations are visible during ObjC lookups
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 22 18:17:01 PDT 2017
rsmith updated this revision to Diff 103678.
rsmith added a comment.
The remaining missing pieces were `ObjCInterfaceDecl::visible_categories` and `ObjCInterfaceDecl::visible_extensions`. The new revision of the patch gets a bit further down the road of passing through real visibility information into those, but that approach seems to snowball out of control. For example, `ASTContext::mergeTypes` now needs visibility information in order to determine whether two ObjC object types are compatible (because this depends on whether the types have compatible sets of protocols, which in turn can vary depending on which categories are visible for those two types). I have not completed this patch: there are still a lot of places that an IsHiddenFunction would need to be plumbed through to make this work.
The fact that type compatibility can vary depending on the context in which you ask seems like a significant design issue with ObjC categories; perhaps a modest and reasonable change to the language (and particularly the interaction between modules and categories) could avoid at least some of this implementation complexity, but I'm not the right person to design or champion such a change.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 158983 bytes
Desc: not available
More information about the cfe-commits