mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Outliner: Add comment explaining that getBridgeTo/FromObjectiveC returns an invalid SILDeclRef to signal that the type does not conform to the bridgeable protocol
This commit is contained in:
@@ -491,6 +491,8 @@ static bool matchSwitch(SwitchInfo &SI, SILInstruction *Inst,
|
||||
auto NativeType = Apply->getType().getASTType();
|
||||
auto *BridgeFun = FunRef->getInitiallyReferencedFunction();
|
||||
auto *SwiftModule = BridgeFun->getModule().getSwiftModule();
|
||||
// Not every type conforms to the ObjectiveCBridgeable protocol in such a case
|
||||
// getBridgeFromObjectiveC returns SILDeclRef().
|
||||
auto bridgeWitness = getBridgeFromObjectiveC(NativeType, SwiftModule);
|
||||
if (bridgeWitness == SILDeclRef() ||
|
||||
BridgeFun->getName() != bridgeWitness.mangle())
|
||||
@@ -809,6 +811,8 @@ BridgedArgument BridgedArgument::match(unsigned ArgIdx, SILValue Arg,
|
||||
auto NativeType = BridgedValue->getType().getASTType();
|
||||
auto *BridgeFun = FunRef->getInitiallyReferencedFunction();
|
||||
auto *SwiftModule = BridgeFun->getModule().getSwiftModule();
|
||||
// Not every type conforms to the ObjectiveCBridgeable protocol in such a case
|
||||
// getBridgeToObjectiveC returns SILDeclRef().
|
||||
auto bridgeWitness = getBridgeToObjectiveC(NativeType, SwiftModule);
|
||||
if (bridgeWitness == SILDeclRef() ||
|
||||
BridgeFun->getName() != bridgeWitness.mangle())
|
||||
|
||||
Reference in New Issue
Block a user