]> granicus.if.org Git - clang/commit
[Objective-C] Introduce objc_runtime_visible attribute.
authorDouglas Gregor <dgregor@apple.com>
Fri, 1 Apr 2016 23:23:52 +0000 (23:23 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 1 Apr 2016 23:23:52 +0000 (23:23 +0000)
commitcf7bc8edf8cccb1b5de656c403cb55ad44132e98
treeec2e8afeb49dc4d704646244a31f7338544be47e
parent0a54ccf3d639cd191bf4c46f81a240675500a6e5
[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
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGObjCMac.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaDeclObjC.cpp
test/CodeGenObjC/attr-objc-runtime-visible.m [new file with mode: 0644]
test/SemaObjC/attr-objc-runtime-visible.m [new file with mode: 0644]