Skip to content

Commit 41f4d5c

Browse files
authored
Merge pull request #13159 from slavapestov/reapply-volatile-witness-method-inst
Re-apply "SIL: Use objc_method instruction for Objective-C protocol method calls"
2 parents ec0d53f + 741c4db commit 41f4d5c

32 files changed

+108
-128
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,11 +1282,10 @@ class SILBuilder {
12821282

12831283
WitnessMethodInst *createWitnessMethod(SILLocation Loc, CanType LookupTy,
12841284
ProtocolConformanceRef Conformance,
1285-
SILDeclRef Member, SILType MethodTy,
1286-
bool Volatile = false) {
1285+
SILDeclRef Member, SILType MethodTy) {
12871286
return insert(WitnessMethodInst::create(
12881287
getSILDebugLocation(Loc), LookupTy, Conformance, Member, MethodTy,
1289-
&getFunction(), OpenedArchetypes, Volatile));
1288+
&getFunction(), OpenedArchetypes));
12901289
}
12911290

12921291
OpenExistentialAddrInst *

include/swift/SIL/SILCloner.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,7 @@ SILCloner<ImplClass>::visitWitnessMethodInst(WitnessMethodInst *Inst) {
16401640
.createWitnessMethod(
16411641
getOpLocation(Inst->getLoc()),
16421642
newLookupType, conformance,
1643-
Inst->getMember(), Inst->getType(),
1644-
Inst->isVolatile()));
1643+
Inst->getMember(), Inst->getType()));
16451644
}
16461645

16471646
template<typename ImplClass>

include/swift/SIL/SILInstruction.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5464,16 +5464,13 @@ class WitnessMethodInst final
54645464
CanType LookupType;
54655465
ProtocolConformanceRef Conformance;
54665466
unsigned NumOperands;
5467-
bool Volatile;
54685467

54695468
WitnessMethodInst(SILDebugLocation DebugLoc, CanType LookupType,
54705469
ProtocolConformanceRef Conformance, SILDeclRef Member,
5471-
SILType Ty, ArrayRef<SILValue> TypeDependentOperands,
5472-
bool Volatile = false)
5470+
SILType Ty, ArrayRef<SILValue> TypeDependentOperands)
54735471
: InstructionBase(DebugLoc, Ty, Member),
54745472
LookupType(LookupType), Conformance(Conformance),
5475-
NumOperands(TypeDependentOperands.size()),
5476-
Volatile(Volatile) {
5473+
NumOperands(TypeDependentOperands.size()) {
54775474
TrailingOperandsList::InitOperandsList(getAllOperands().begin(), this,
54785475
TypeDependentOperands);
54795476
}
@@ -5493,8 +5490,7 @@ class WitnessMethodInst final
54935490
static WitnessMethodInst *
54945491
create(SILDebugLocation DebugLoc, CanType LookupType,
54955492
ProtocolConformanceRef Conformance, SILDeclRef Member, SILType Ty,
5496-
SILFunction *Parent, SILOpenedArchetypesState &OpenedArchetypes,
5497-
bool Volatile = false);
5493+
SILFunction *Parent, SILOpenedArchetypesState &OpenedArchetypes);
54985494

54995495
public:
55005496
~WitnessMethodInst() {
@@ -5510,8 +5506,6 @@ class WitnessMethodInst final
55105506
->getAsProtocolOrProtocolExtensionContext();
55115507
}
55125508

5513-
bool isVolatile() const { return Volatile; }
5514-
55155509
ProtocolConformanceRef getConformance() const { return Conformance; }
55165510

55175511
ArrayRef<Operand> getAllOperands() const {

include/swift/Serialization/ModuleFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
5454
/// in source control, you should also update the comment to briefly
5555
/// describe what change you made. The content of this comment isn't important;
5656
/// it just ensures a conflict if two people change the module format.
57-
const uint16_t VERSION_MINOR = 389; // Last change: don't serialize 'self'
57+
const uint16_t VERSION_MINOR = 340; // Last change: remove 'volatile' bit from witness_method
5858

5959
using DeclIDField = BCFixed<31>;
6060

lib/IRGen/IRGenSIL.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,13 +5024,6 @@ IRGenSILFunction::visitProjectExistentialBoxInst(ProjectExistentialBoxInst *i) {
50245024
}
50255025

50265026
void IRGenSILFunction::visitWitnessMethodInst(swift::WitnessMethodInst *i) {
5027-
// For Objective-C classes we need to arrange for a msgSend
5028-
// to happen when the method is called.
5029-
if (i->getMember().isForeign) {
5030-
setLoweredObjCMethod(i, i->getMember());
5031-
return;
5032-
}
5033-
50345027
CanType baseTy = i->getLookupType();
50355028
ProtocolConformanceRef conformance = i->getConformance();
50365029
SILDeclRef member = i->getMember();

lib/IRGen/LoadableByAddress.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,6 @@ static void rewriteFunction(StructLoweringState &pass,
19971997
}
19981998
case SILInstructionKind::WitnessMethodInst: {
19991999
auto *WMI = dyn_cast<WitnessMethodInst>(instr);
2000-
assert(!WMI->isVolatile());
20012000
assert(WMI && "ValueKind is Witness Method but dyn_cast failed");
20022001
newInstr = methodBuilder.createWitnessMethod(
20032002
loc, WMI->getLookupType(), WMI->getConformance(), member, newSILType);

lib/ParseSIL/ParseSIL.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3902,9 +3902,6 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
39023902
break;
39033903
}
39043904
case SILInstructionKind::WitnessMethodInst: {
3905-
bool IsVolatile = false;
3906-
if (parseSILOptional(IsVolatile, *this, "volatile"))
3907-
return true;
39083905
CanType LookupTy;
39093906
SILDeclRef Member;
39103907
SILType MethodTy;
@@ -3945,7 +3942,7 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
39453942
}
39463943

39473944
ResultVal = B.createWitnessMethod(InstLoc, LookupTy, Conformance, Member,
3948-
MethodTy, IsVolatile);
3945+
MethodTy);
39493946
break;
39503947
}
39513948
case SILInstructionKind::CopyAddrInst: {

lib/SIL/SILInstruction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,6 @@ namespace {
807807

808808
bool visitWitnessMethodInst(const WitnessMethodInst *RHS) {
809809
auto *X = cast<WitnessMethodInst>(LHS);
810-
if (X->isVolatile() != RHS->isVolatile())
811-
return false;
812810
if (X->getMember() != RHS->getMember())
813811
return false;
814812
if (X->getLookupType() != RHS->getLookupType())

lib/SIL/SILInstructions.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,8 +1688,7 @@ WitnessMethodInst *
16881688
WitnessMethodInst::create(SILDebugLocation Loc, CanType LookupType,
16891689
ProtocolConformanceRef Conformance, SILDeclRef Member,
16901690
SILType Ty, SILFunction *F,
1691-
SILOpenedArchetypesState &OpenedArchetypes,
1692-
bool Volatile) {
1691+
SILOpenedArchetypesState &OpenedArchetypes) {
16931692
assert(cast<ProtocolDecl>(Member.getDecl()->getDeclContext())
16941693
== Conformance.getRequirement());
16951694

@@ -1704,7 +1703,7 @@ WitnessMethodInst::create(SILDebugLocation Loc, CanType LookupType,
17041703

17051704
declareWitnessTable(Mod, Conformance);
17061705
return ::new (Buffer) WitnessMethodInst(Loc, LookupType, Conformance, Member,
1707-
Ty, TypeDependentOperands, Volatile);
1706+
Ty, TypeDependentOperands);
17081707
}
17091708

17101709
ObjCMethodInst *

lib/SIL/SILPrinter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,8 +1669,6 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
16691669
PrintOptions QualifiedSILTypeOptions =
16701670
PrintOptions::printQualifiedSILType();
16711671
QualifiedSILTypeOptions.CurrentModule = WMI->getModule().getSwiftModule();
1672-
if (WMI->isVolatile())
1673-
*this << "[volatile] ";
16741672
*this << "$" << WMI->getLookupType() << ", " << WMI->getMember() << " : ";
16751673
WMI->getMember().getDecl()->getInterfaceType().print(
16761674
PrintState.OS, QualifiedSILTypeOptions);

lib/SIL/SILVerifier.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,22 +2184,24 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
21842184
"result of objc_method");
21852185
require(!methodType->getExtInfo().hasContext(),
21862186
"result method must be of a context-free function type");
2187+
require(methodType->getRepresentation()
2188+
== SILFunctionTypeRepresentation::ObjCMethod,
2189+
"wrong function type representation");
21872190

2188-
auto methodSelfType = getMethodSelfType(methodType);
21892191
auto operandType = OMI->getOperand()->getType();
2192+
auto operandInstanceType = operandType.getSwiftRValueType();
2193+
if (auto metatypeType = dyn_cast<MetatypeType>(operandInstanceType))
2194+
operandInstanceType = metatypeType.getInstanceType();
21902195

2191-
if (methodSelfType.isClassOrClassMetatype()) {
2196+
if (operandInstanceType.getClassOrBoundGenericClass()) {
21922197
auto overrideTy = TC.getConstantOverrideType(member);
21932198
requireSameType(
21942199
OMI->getType(), SILType::getPrimitiveObjectType(overrideTy),
21952200
"result type of objc_method must match abstracted type of method");
2196-
require(operandType.isClassOrClassMetatype(),
2197-
"operand must be of a class type");
21982201
} else {
2199-
require(getDynamicMethodType(operandType, OMI->getMember())
2200-
.getSwiftRValueType()
2201-
->isBindableTo(OMI->getType().getSwiftRValueType()),
2202-
"result must be of the method's type");
2202+
require(isa<ArchetypeType>(operandInstanceType) ||
2203+
operandInstanceType->isObjCExistentialType(),
2204+
"operand type must be an archetype or self-conforming existential");
22032205
verifyOpenedArchetype(OMI, OMI->getType().getSwiftRValueType());
22042206
}
22052207

lib/SILGen/SILGenApply.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,10 @@ class Callee {
418418
case Kind::IndirectValue:
419419
case Kind::StandaloneFunction:
420420
case Kind::EnumElement:
421+
return false;
421422
case Kind::WitnessMethod:
423+
if (Constant.isForeign)
424+
return true;
422425
return false;
423426
case Kind::ClassMethod:
424427
case Kind::SuperMethod:
@@ -548,9 +551,17 @@ class Callee {
548551
->getRValueInstanceType()
549552
->getCanonicalType();
550553

551-
SILValue fn = SGF.B.createWitnessMethod(
554+
SILValue fn;
555+
556+
if (!constant->isForeign) {
557+
fn = SGF.B.createWitnessMethod(
552558
Loc, lookupType, ProtocolConformanceRef(proto), *constant,
553-
constantInfo.getSILType(), constant->isForeign);
559+
constantInfo.getSILType());
560+
} else {
561+
fn = SGF.B.createObjCMethod(Loc, borrowedSelf->getValue(),
562+
*constant, constantInfo.getSILType());
563+
}
564+
554565
return ManagedValue::forUnmanaged(fn);
555566
}
556567
case Kind::DynamicMethod: {

lib/SILGen/SILGenBridging.cpp

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,31 +1498,17 @@ getThunkedForeignFunctionRef(SILGenFunction &SGF,
14981498
const SILConstantInfo &foreignCI) {
14991499
assert(!foreign.isCurried
15001500
&& "should not thunk calling convention when curried");
1501+
assert(foreign.isForeign);
15011502

1502-
// Produce a witness_method when thunking ObjC protocol methods.
1503-
auto dc = foreign.getDecl()->getDeclContext();
1504-
if (isa<ProtocolDecl>(dc) && cast<ProtocolDecl>(dc)->isObjC()) {
1505-
assert(subs.size() == 1);
1506-
auto thisType = subs[0].getReplacement()->getCanonicalType();
1507-
assert(isa<ArchetypeType>(thisType) && "no archetype for witness?!");
1508-
SILValue thisArg = args.back().getValue();
1509-
1510-
SILValue OpenedExistential;
1511-
if (!cast<ArchetypeType>(thisType)->getOpenedExistentialType().isNull())
1512-
OpenedExistential = thisArg;
1513-
auto conformance = ProtocolConformanceRef(cast<ProtocolDecl>(dc));
1514-
return SGF.B.createWitnessMethod(loc, thisType, conformance, foreign,
1515-
foreignCI.getSILType(),
1516-
OpenedExistential);
1517-
1518-
// Produce a class_method when thunking imported ObjC methods.
1519-
} else if (foreignCI.SILFnType->getRepresentation()
1503+
// Produce an objc_method when thunking ObjC methods.
1504+
if (foreignCI.SILFnType->getRepresentation()
15201505
== SILFunctionTypeRepresentation::ObjCMethod) {
15211506
SILValue thisArg = args.back().getValue();
15221507

15231508
return SGF.B.createObjCMethod(loc, thisArg, foreign,
1524-
SILType::getPrimitiveObjectType(foreignCI.SILFnType));
1509+
foreignCI.getSILType());
15251510
}
1511+
15261512
// Otherwise, emit a function_ref.
15271513
return SGF.emitGlobalFunctionRef(loc, foreign);
15281514
}

lib/SILGen/SILGenThunk.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,8 @@ static SILValue getNextUncurryLevelRef(SILGenFunction &SGF,
221221
auto origSelfType = protocol->getSelfInterfaceType()->getCanonicalType();
222222
auto substSelfType = origSelfType.subst(subMap)->getCanonicalType();
223223
auto conformance = subMap.lookupConformance(origSelfType, protocol);
224-
SILValue OpenedExistential;
225-
if (substSelfType->isOpenedExistential())
226-
OpenedExistential = selfArg;
227224
return SGF.B.createWitnessMethod(loc, substSelfType, *conformance, next,
228-
constantInfo.getSILType(),
229-
OpenedExistential);
225+
constantInfo.getSILType());
230226
}
231227
}
232228

lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ CalleeList CalleeCache::getCalleeList(SILDeclRef Decl) const {
189189

190190
// Return a callee list for the given witness method.
191191
CalleeList CalleeCache::getCalleeList(WitnessMethodInst *WMI) const {
192-
if (WMI->isVolatile())
193-
return CalleeList();
194-
195192
// First attempt to see if we can narrow it down to a single
196193
// function based on the conformance.
197194
if (auto *CalleeFn = getSingleCalleeForWitnessMethod(WMI))

lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,7 @@ SILCombiner::propagateConcreteTypeOfInitExistential(FullApplySite AI,
10501050
auto *NewWMI = Builder.createWitnessMethod(WMI->getLoc(),
10511051
ConcreteType,
10521052
Conformance, WMI->getMember(),
1053-
WMI->getType(),
1054-
WMI->isVolatile());
1053+
WMI->getType());
10551054
// Replace only uses of the witness_method in the apply that is going to
10561055
// be changed.
10571056
MutableArrayRef<Operand> Operands = AI.getInstruction()->getAllOperands();

lib/SILOptimizer/Transforms/CSE.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,6 @@ bool CSE::canHandle(SILInstruction *Inst) {
880880
return false;
881881
return !BI->mayReadOrWriteMemory();
882882
}
883-
if (auto *WMI = dyn_cast<WitnessMethodInst>(Inst)) {
884-
return !WMI->isVolatile();
885-
}
886883
if (auto *EMI = dyn_cast<ExistentialMetatypeInst>(Inst)) {
887884
return !EMI->getOperand()->getType().isAddress();
888885
}
@@ -937,6 +934,7 @@ bool CSE::canHandle(SILInstruction *Inst) {
937934
case SILInstructionKind::PointerToThinFunctionInst:
938935
case SILInstructionKind::MarkDependenceInst:
939936
case SILInstructionKind::OpenExistentialRefInst:
937+
case SILInstructionKind::WitnessMethodInst:
940938
return true;
941939
default:
942940
return false;

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,8 +2371,8 @@ static SILBasicBlock *isObjCMethodCallBlock(SILBasicBlock &Block) {
23712371
auto *Apply = dyn_cast<ApplyInst>(&Inst);
23722372
if (!Apply)
23732373
continue;
2374-
auto *Callee = dyn_cast<WitnessMethodInst>(Apply->getCallee());
2375-
if (!Callee || !Callee->getMember().isForeign)
2374+
auto *Callee = dyn_cast<ObjCMethodInst>(Apply->getCallee());
2375+
if (!Callee)
23762376
continue;
23772377

23782378
return Branch->getDestBB();

lib/Serialization/DeserializeSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
19851985
ExistentialOperand = getLocalValue(ValID3, ExistentialOperandTy);
19861986
}
19871987
ResultVal = Builder.createWitnessMethod(
1988-
Loc, Ty, Conformance, DRef, OperandTy, Attr);
1988+
Loc, Ty, Conformance, DRef, OperandTy);
19891989
break;
19901990
}
19911991
case SILInstructionKind::DynamicMethodBranchInst: {

lib/Serialization/SerializeSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
17301730

17311731
SILInstWitnessMethodLayout::emitRecord(
17321732
Out, ScratchRecord, SILAbbrCodes[SILInstWitnessMethodLayout::Code],
1733-
S.addTypeRef(Ty), 0, WMI->isVolatile(),
1733+
S.addTypeRef(Ty), 0, 0,
17341734
S.addTypeRef(Ty2.getSwiftRValueType()), (unsigned)Ty2.getCategory(),
17351735
OperandTy, OperandTyCategory, OperandValueId, ListOfValues);
17361736

test/SIL/Parser/basic.sil

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ bb0(%0: $Optional<D>):
279279
// Generated from:
280280
// func archetype_member_ref<T:Runcible>(x:T) {
281281
// x.free_method()
282-
// var u = x.associated_method()
283282
// T.static_method()
284283
// }
285284

@@ -290,28 +289,20 @@ protocol Runcible {
290289
static func static_method()
291290
}
292291

293-
/* SIL parsing of substitutions in apply insts is totally busted.
294-
// C/HECK: $@convention(thin) <T : Runcible> (@in T) -> ()
292+
// CHECK: $@convention(thin) <T where T : Runcible> (@in T) -> ()
295293
sil @_T4arch20archetype_member_refUS_8Runcible___FT1xQ__T_ : $@convention(thin) <T : Runcible> (@in T) -> () {
296294
bb0(%0 : $*T):
297-
// C/HECK: witness_method $*T, #Runcible.free_method!1
298-
%1 = witness_method $*T, #Runcible.free_method!1 : $@cc(method) (@inout T) -> Int
299-
%2 = apply %1(%0) : $@cc(method) (@inout T) -> Int
300-
%3 = alloc_stack $@thick T.U.Type
301-
// C/HECK: witness_method $*T, #Runcible.associated_method!1
302-
%4 = witness_method $*T, #Runcible.associated_method!1 : $@cc(method) (@inout T) -> @thick T.U.Type
303-
%5 = apply %4(%0) : $@cc(method) (@inout T) -> @thick T.U.Type
304-
store %5 to %3 : $*@thick T.U.Type
305-
%7 = metatype $@thick T.Type
306-
// C/HECK: witness_method [volatile] $*T, #Runcible.static_method!1
307-
%8 = witness_method [volatile] $*T, #Runcible.static_method!1 : $(@thick T.Type) -> ()
308-
%9 = apply %8(%7) : $(@thick T.Type) -> ()
309-
dealloc_stack %3 : $*@thick T.U.Type
310-
%11 = tuple ()
295+
// CHECK: witness_method $T, #Runcible.free_method!1
296+
%1 = witness_method $T, #Runcible.free_method!1 : $@convention(witness_method: Runcible) <Self : Runcible> (@in Self) -> Int
297+
%2 = apply %1<T>(%0) : $@convention(witness_method: Runcible) <Self : Runcible> (@in Self) -> Int
298+
%3 = metatype $@thick T.Type
299+
// CHECK: witness_method $T, #Runcible.static_method!1
300+
%4 = witness_method $T, #Runcible.static_method!1 : $@convention(witness_method: Runcible) <Self : Runcible> (@thick T.Type) -> ()
301+
%5 = apply %4<T>(%3) : $@convention(witness_method: Runcible) <Self : Runcible> (@thick T.Type) -> ()
302+
%6 = tuple ()
311303
destroy_addr %0 : $*T
312-
return %11 : $()
304+
return %6 : $()
313305
}
314-
*/
315306

316307
protocol Bendable { }
317308

test/SILGen/foreign_errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ class VeryErrorProne : ErrorProne {
212212
func testProtocol(_ p: ErrorProneProtocol) throws {
213213
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
214214
// CHECK: [[T0:%.*]] = open_existential_ref [[BORROWED_ARG0]] : $ErrorProneProtocol to $[[OPENED:@opened(.*) ErrorProneProtocol]]
215-
// CHECK: [[T1:%.*]] = witness_method [volatile] $[[OPENED]], #ErrorProneProtocol.obliterate!1.foreign : {{.*}}, [[T0]] : $[[OPENED]] :
215+
// CHECK: [[T1:%.*]] = objc_method [[T0]] : $[[OPENED]], #ErrorProneProtocol.obliterate!1.foreign : {{.*}}
216216
// CHECK: apply [[T1]]<[[OPENED]]>({{%.*}}, [[T0]]) : $@convention(objc_method) <τ_0_0 where τ_0_0 : ErrorProneProtocol> (Optional<AutoreleasingUnsafeMutablePointer<Optional<NSError>>>, τ_0_0) -> ObjCBool
217217
try p.obliterate()
218218

219219
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
220220
// CHECK: [[T0:%.*]] = open_existential_ref [[BORROWED_ARG0]] : $ErrorProneProtocol to $[[OPENED:@opened(.*) ErrorProneProtocol]]
221-
// CHECK: [[T1:%.*]] = witness_method [volatile] $[[OPENED]], #ErrorProneProtocol.invigorate!1.foreign : {{.*}}, [[T0]] : $[[OPENED]] :
221+
// CHECK: [[T1:%.*]] = objc_method [[T0]] : $[[OPENED]], #ErrorProneProtocol.invigorate!1.foreign : {{.*}}
222222
// CHECK: apply [[T1]]<[[OPENED]]>({{%.*}}, {{%.*}}, [[T0]]) : $@convention(objc_method) <τ_0_0 where τ_0_0 : ErrorProneProtocol> (Optional<AutoreleasingUnsafeMutablePointer<Optional<NSError>>>, Optional<@convention(block) () -> ()>, τ_0_0) -> ObjCBool
223223
try p.invigorate(callback: {})
224224
}

0 commit comments

Comments
 (0)