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:
@@ -2325,13 +2325,14 @@ getWitnessFunctionType(SILModule &M,
|
||||
CanType origLoweredTy;
|
||||
if (auto origFTy = dyn_cast<AnyFunctionType>(origRequirementTy.getAsType()))
|
||||
origLoweredTy = M.Types.getLoweredASTFunctionType(origFTy,
|
||||
uncurryLevel);
|
||||
uncurryLevel,
|
||||
None);
|
||||
else
|
||||
origLoweredTy = origRequirementTy.getAsType();
|
||||
auto witnessLoweredTy
|
||||
= M.Types.getLoweredASTFunctionType(witnessSubstTy, uncurryLevel);
|
||||
= M.Types.getLoweredASTFunctionType(witnessSubstTy, uncurryLevel, None);
|
||||
auto witnessLoweredIfaceTy
|
||||
= M.Types.getLoweredASTFunctionType(witnessSubstIfaceTy, uncurryLevel);
|
||||
= M.Types.getLoweredASTFunctionType(witnessSubstIfaceTy, uncurryLevel, None);
|
||||
|
||||
// Convert to SILFunctionType.
|
||||
auto fnTy = getNativeSILFunctionType(M, origLoweredTy,
|
||||
|
||||
Reference in New Issue
Block a user