Allow '@objc(RuntimeName)' on classes with generic ancestry.

This is accomplished by recognizing this specific situation and
replacing the 'objc' attribute with a hidden '_objcRuntimeName'
attribute. This /only/ applies to classes that are themselves
non-generic (including any enclosing generic context) but that have
generic ancestry, and thus cannot be exposed directly to Objective-C.

This commit also eliminates '@NSKeyedArchiverClassName'. It was
decided that the distinction between '@NSKeyedArchiverClassName' and
'@objc' was too subtle to be worth explaining to developers, and that
any case where you'd use '@NSKeyedArchiverClassName' was already a
place where the ObjC name wasn't visible at compile time.

This commit does not update diagnostics to reflect this change; we're
going to change them anyway.

rdar://problem/32414557
This commit is contained in:
Jordan Rose
2017-06-02 16:14:07 -07:00
parent ea5a42d36d
commit f0aca936c7
25 changed files with 126 additions and 144 deletions

View File

@@ -1321,8 +1321,8 @@ namespace decls_block {
using SynthesizedProtocolDeclAttrLayout
= BCRecordLayout<SynthesizedProtocol_DECL_ATTR>;
using ImplementsDeclAttrLayout = BCRecordLayout<Implements_DECL_ATTR>;
using NSKeyedArchiverClassNameDeclAttrLayout
= BCRecordLayout<NSKeyedArchiverClassName_DECL_ATTR>;
using ObjCRuntimeNameDeclAttrLayout
= BCRecordLayout<ObjCRuntimeName_DECL_ATTR>;
using InlineDeclAttrLayout = BCRecordLayout<
Inline_DECL_ATTR,