HomePhabricator

[Objective-C] Introduce objc_runtime_visible attribute.

Authored by doug.gregor on Apr 1 2016, 4:23 PM.

Description

[Objective-C] Introduce objc_runtime_visible attribute.

The objc_runtime_visible attribute deals with an odd corner case where
a particular Objective-C class is known to the Objective-C runtime
(and, therefore, accessible by name) but its symbol has been hidden
for some reason. For such classes, teach CodeGen to use
objc_lookUpClass to retrieve the Class object, rather than referencing
the class symbol directly.

Classes annotated with objc_runtime_visible have two major limitations
that fall out from places where Objective-C metadata needs to refer to
the class (or metaclass) symbol directly:

  • One cannot implement a subclass of an objc_runtime_visible class.
  • One cannot implement a category on an objc_runtime_visible class.

Implements rdar://problem/25494092.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265201 91177308-0d34-0410-b5e6-96231b3b80d8
apple-llvm-split-commit: dfc8d2d85ae7bc36824c3f3427207710c9051d6e
apple-llvm-split-dir: clang/

Details

Committed
doug.gregorApr 1 2016, 9:00 PM
Parents
rGaa12a7e6afe9: Merge remote-tracking branch 'mirror/master' into upstream-with-swift
Branches
Unknown
Tags
Unknown