@@ -596,28 +596,25 @@ SILInstruction *CastOptimizer::optimizeBridgedSwiftToObjCCast(
596596 return NewI;
597597}
598598
599- SILInstruction *CastOptimizer::optimizeBridgedCasts (SILDynamicCastInst cast) {
600- return optimizeBridgedCasts (
601- cast.getInstruction (), cast.getBridgedConsumptionKind (),
602- cast.isConditional (), cast.getSource (), cast.getDest (),
603- cast.getSourceType (), cast.getTargetType (), cast.getSuccessBlock (),
604- cast.getFailureBlock ());
605- }
606-
607- // / Make use of the fact that some of these casts cannot fail.
608- // / For example, if the ObjC type is exactly the expected
609- // / _ObjectiveCType type, then it would always succeed for
610- // / NSString, NSNumber, etc.
611- // / Casts from NSArray, NSDictionary and NSSet may fail.
599+ // / Make use of the fact that some of these casts cannot fail. For example, if
600+ // / the ObjC type is exactly the expected _ObjectiveCType type, then it would
601+ // / always succeed for NSString, NSNumber, etc. Casts from NSArray,
602+ // / NSDictionary and NSSet may fail.
612603// /
613- // / If ObjC class is not exactly _ObjectiveCType, then
614- // / its conversion to a required _ObjectiveCType may fail.
615- SILInstruction *CastOptimizer::optimizeBridgedCasts (
616- SILInstruction *Inst, CastConsumptionKind ConsumptionKind,
617- bool isConditional, SILValue Src, SILValue Dest, CanType source,
618- CanType target, SILBasicBlock *SuccessBB, SILBasicBlock *FailureBB) {
619-
620- auto &M = Inst->getModule ();
604+ // / If ObjC class is not exactly _ObjectiveCType, then its conversion to a
605+ // / required _ObjectiveCType may fail.
606+ SILInstruction *
607+ CastOptimizer::optimizeBridgedCasts (SILDynamicCastInst dynamicCast) {
608+ SILInstruction *Inst = dynamicCast.getInstruction ();
609+ CastConsumptionKind ConsumptionKind = dynamicCast.getBridgedConsumptionKind ();
610+ bool isConditional = dynamicCast.isConditional ();
611+ SILValue Src = dynamicCast.getSource ();
612+ SILValue Dest = dynamicCast.getDest ();
613+ CanType source = dynamicCast.getSourceType ();
614+ CanType target = dynamicCast.getTargetType ();
615+ SILBasicBlock *SuccessBB = dynamicCast.getSuccessBlock ();
616+ SILBasicBlock *FailureBB = dynamicCast.getFailureBlock ();
617+ auto &M = dynamicCast.getModule ();
621618
622619 // To apply the bridged optimizations, we should ensure that types are not
623620 // existential (and keep in mind that generic parameters can be existentials),
0 commit comments