mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Consider the original Clang type of a decl before bridging Bool back to ObjCBool.
It's not always correct to map a Swift Bool back to ObjCBool in C land, since Bool could have originally been a proper _Bool. Pass the clang::Decl down to type lowering so we can recognize this. We still don't have a great solution for block types, because there's no decl to refer to, and Swift's user-level type system erases the distinction between void(^)(_Bool) and void(^)(BOOL). However, this is enough to let us start using C APIs that traffic in _Bool. Swift SVN r23546
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
- (BOOL) zim;
|
||||
- (void) setZim: (BOOL)b;
|
||||
|
||||
- (_Bool) zang;
|
||||
- (void) setZang: (_Bool)b;
|
||||
|
||||
@end
|
||||
|
||||
NSString *bar(void);
|
||||
@@ -38,4 +41,9 @@ NSString *NSStringFromClass(Class c);
|
||||
#define CF_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
||||
#define NS_ENUM(_type, _name) CF_ENUM(_type, _name)
|
||||
|
||||
BOOL getBOOL(void);
|
||||
_Bool getBool(void);
|
||||
|
||||
|
||||
void useBOOL(BOOL x);
|
||||
void useBool(_Bool x);
|
||||
|
||||
Reference in New Issue
Block a user