Mangle imported declarations using their C names.

This makes them consistent no matter what shenanigans are pulled by
the importer, particularly NS_ENUM vs. NS_OPTIONS and NS_SWIFT_NAME.

The 'NSErrorDomain' API note /nearly/ works with this, but the
synthesized error struct is still mangled as a Swift declaration,
which means it's not rename-stable. See follow-up commits.

The main place where this still falls down is NS_STRING_ENUM: when
this is applied, a typedef is imported as a unique struct, but without
it it's just a typealias for the underlying type. There's also still a
problem with synthesized conformances, which have a module mangled
into the witness table symbol even though that symbol is linkonce_odr.

rdar://problem/31616162
This commit is contained in:
Jordan Rose
2017-04-19 17:55:56 -07:00
parent bfa4ca4f00
commit 38e2cfe1e2
33 changed files with 319 additions and 186 deletions

View File

@@ -5,6 +5,10 @@
- (void) anse;
@end
__attribute__((swift_name("BetterAnsing")))
@protocol NSBetterAnsing <NSAnsing>
@end
@interface NSObject (NSAnsing)
@property Class<NSAnsing> qualifiedClassProp;
@end