Skip to content

Commit 53bb5ea

Browse files
Merge pull request #13148 from apple/revert-13139-no-more-volatile-witness-method
Revert "SIL: Use objc_method instruction for Objective-C protocol method calls"
2 parents 0d91b89 + ea9907a commit 53bb5ea

31 files changed

+110
-75
lines changed

include/swift/SIL/SILBuilder.h

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

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

12911292
OpenExistentialAddrInst *

include/swift/SIL/SILCloner.h

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

16461647
template<typename ImplClass>

include/swift/SIL/SILInstruction.h

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

54685469
WitnessMethodInst(SILDebugLocation DebugLoc, CanType LookupType,
54695470
ProtocolConformanceRef Conformance, SILDeclRef Member,
5470-
SILType Ty, ArrayRef<SILValue> TypeDependentOperands)
5471+
SILType Ty, ArrayRef<SILValue> TypeDependentOperands,
5472+
bool Volatile = false)
54715473
: InstructionBase(DebugLoc, Ty, Member),
54725474
LookupType(LookupType), Conformance(Conformance),
5473-
NumOperands(TypeDependentOperands.size()) {
5475+
NumOperands(TypeDependentOperands.size()),
5476+
Volatile(Volatile) {
54745477
TrailingOperandsList::InitOperandsList(getAllOperands().begin(), this,
54755478
TypeDependentOperands);
54765479
}
@@ -5490,7 +5493,8 @@ class WitnessMethodInst final
54905493
static WitnessMethodInst *
54915494
create(SILDebugLocation DebugLoc, CanType LookupType,
54925495
ProtocolConformanceRef Conformance, SILDeclRef Member, SILType Ty,
5493-
SILFunction *Parent, SILOpenedArchetypesState &OpenedArchetypes);
5496+
SILFunction *Parent, SILOpenedArchetypesState &OpenedArchetypes,
5497+
bool Volatile = false);
54945498

54955499
public:
54965500
~WitnessMethodInst() {
@@ -5506,6 +5510,8 @@ class WitnessMethodInst final
55065510
->getAsProtocolOrProtocolExtensionContext();
55075511
}
55085512

5513+
bool isVolatile() const { return Volatile; }
5514+
55095515
ProtocolConformanceRef getConformance() const { return Conformance; }
55105516

55115517
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 = 340; // Last change: remove 'volatile' bit from witness_method
57+
const uint16_t VERSION_MINOR = 389; // Last change: don't serialize 'self'
5858

5959
using DeclIDField = BCFixed<31>;
6060

lib/IRGen/IRGenSIL.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,6 +5024,13 @@ 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+
50275034
CanType baseTy = i->getLookupType();
50285035
ProtocolConformanceRef conformance = i->getConformance();
50295036
SILDeclRef member = i->getMember();

lib/IRGen/LoadableByAddress.cpp

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

lib/ParseSIL/ParseSIL.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3902,6 +3902,9 @@ 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;
39053908
CanType LookupTy;
39063909
SILDeclRef Member;
39073910
SILType MethodTy;
@@ -3942,7 +3945,7 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
39423945
}
39433946

39443947
ResultVal = B.createWitnessMethod(InstLoc, LookupTy, Conformance, Member,
3945-
MethodTy);
3948+
MethodTy, IsVolatile);
39463949
break;
39473950
}
39483951
case SILInstructionKind::CopyAddrInst: {

lib/SIL/SILInstruction.cpp

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

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

lib/SIL/SILInstructions.cpp

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

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

17041705
declareWitnessTable(Mod, Conformance);
17051706
return ::new (Buffer) WitnessMethodInst(Loc, LookupType, Conformance, Member,
1706-
Ty, TypeDependentOperands);
1707+
Ty, TypeDependentOperands, Volatile);
17071708
}
17081709

17091710
ObjCMethodInst *

lib/SIL/SILPrinter.cpp

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

lib/SIL/SILVerifier.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,21 +2187,19 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
21872187

21882188
auto methodSelfType = getMethodSelfType(methodType);
21892189
auto operandType = OMI->getOperand()->getType();
2190-
auto operandInstanceType = operandType.getSwiftRValueType();
2191-
if (auto metatypeType = dyn_cast<MetatypeType>(operandInstanceType))
2192-
operandInstanceType = metatypeType.getInstanceType();
21932190

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

lib/SILGen/SILGenApply.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,7 @@ class Callee {
418418
case Kind::IndirectValue:
419419
case Kind::StandaloneFunction:
420420
case Kind::EnumElement:
421-
return false;
422421
case Kind::WitnessMethod:
423-
if (Constant.isForeign)
424-
return true;
425422
return false;
426423
case Kind::ClassMethod:
427424
case Kind::SuperMethod:
@@ -551,17 +548,9 @@ class Callee {
551548
->getRValueInstanceType()
552549
->getCanonicalType();
553550

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

lib/SILGen/SILGenBridging.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,17 +1489,31 @@ getThunkedForeignFunctionRef(SILGenFunction &SGF,
14891489
const SILConstantInfo &foreignCI) {
14901490
assert(!foreign.isCurried
14911491
&& "should not thunk calling convention when curried");
1492-
assert(foreign.isForeign);
14931492

1494-
// Produce an objc_method when thunking ObjC methods.
1495-
if (foreignCI.SILFnType->getRepresentation()
1493+
// Produce a witness_method when thunking ObjC protocol methods.
1494+
auto dc = foreign.getDecl()->getDeclContext();
1495+
if (isa<ProtocolDecl>(dc) && cast<ProtocolDecl>(dc)->isObjC()) {
1496+
assert(subs.size() == 1);
1497+
auto thisType = subs[0].getReplacement()->getCanonicalType();
1498+
assert(isa<ArchetypeType>(thisType) && "no archetype for witness?!");
1499+
SILValue thisArg = args.back().getValue();
1500+
1501+
SILValue OpenedExistential;
1502+
if (!cast<ArchetypeType>(thisType)->getOpenedExistentialType().isNull())
1503+
OpenedExistential = thisArg;
1504+
auto conformance = ProtocolConformanceRef(cast<ProtocolDecl>(dc));
1505+
return SGF.B.createWitnessMethod(loc, thisType, conformance, foreign,
1506+
foreignCI.getSILType(),
1507+
OpenedExistential);
1508+
1509+
// Produce a class_method when thunking imported ObjC methods.
1510+
} else if (foreignCI.SILFnType->getRepresentation()
14961511
== SILFunctionTypeRepresentation::ObjCMethod) {
14971512
SILValue thisArg = args.back().getValue();
14981513

14991514
return SGF.B.createObjCMethod(loc, thisArg, foreign,
1500-
foreignCI.getSILType());
1515+
SILType::getPrimitiveObjectType(foreignCI.SILFnType));
15011516
}
1502-
15031517
// Otherwise, emit a function_ref.
15041518
return SGF.emitGlobalFunctionRef(loc, foreign);
15051519
}

lib/SILGen/SILGenThunk.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,12 @@ 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;
224227
return SGF.B.createWitnessMethod(loc, substSelfType, *conformance, next,
225-
constantInfo.getSILType());
228+
constantInfo.getSILType(),
229+
OpenedExistential);
226230
}
227231
}
228232

lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ 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+
192195
// First attempt to see if we can narrow it down to a single
193196
// function based on the conformance.
194197
if (auto *CalleeFn = getSingleCalleeForWitnessMethod(WMI))

lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp

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

lib/SILOptimizer/Transforms/CSE.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,9 @@ 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+
}
883886
if (auto *EMI = dyn_cast<ExistentialMetatypeInst>(Inst)) {
884887
return !EMI->getOperand()->getType().isAddress();
885888
}
@@ -934,7 +937,6 @@ bool CSE::canHandle(SILInstruction *Inst) {
934937
case SILInstructionKind::PointerToThinFunctionInst:
935938
case SILInstructionKind::MarkDependenceInst:
936939
case SILInstructionKind::OpenExistentialRefInst:
937-
case SILInstructionKind::WitnessMethodInst:
938940
return true;
939941
default:
940942
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<ObjCMethodInst>(Apply->getCallee());
2375-
if (!Callee)
2374+
auto *Callee = dyn_cast<WitnessMethodInst>(Apply->getCallee());
2375+
if (!Callee || !Callee->getMember().isForeign)
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);
1988+
Loc, Ty, Conformance, DRef, OperandTy, Attr);
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, 0,
1733+
S.addTypeRef(Ty), 0, WMI->isVolatile(),
17341734
S.addTypeRef(Ty2.getSwiftRValueType()), (unsigned)Ty2.getCategory(),
17351735
OperandTy, OperandTyCategory, OperandValueId, ListOfValues);
17361736

test/SIL/Parser/basic.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ bb0(%0 : $*T):
303303
%5 = apply %4(%0) : $@cc(method) (@inout T) -> @thick T.U.Type
304304
store %5 to %3 : $*@thick T.U.Type
305305
%7 = metatype $@thick T.Type
306-
// C/HECK: objc_method $*T, #Runcible.static_method!1
307-
%8 = objc_method $*T, #Runcible.static_method!1 : $(@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) -> ()
308308
%9 = apply %8(%7) : $(@thick T.Type) -> ()
309309
dealloc_stack %3 : $*@thick T.U.Type
310310
%11 = tuple ()

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:%.*]] = objc_method [[T0]] : $[[OPENED]], #ErrorProneProtocol.obliterate!1.foreign : {{.*}}
215+
// CHECK: [[T1:%.*]] = witness_method [volatile] $[[OPENED]], #ErrorProneProtocol.obliterate!1.foreign : {{.*}}, [[T0]] : $[[OPENED]] :
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:%.*]] = objc_method [[T0]] : $[[OPENED]], #ErrorProneProtocol.invigorate!1.foreign : {{.*}}
221+
// CHECK: [[T1:%.*]] = witness_method [volatile] $[[OPENED]], #ErrorProneProtocol.invigorate!1.foreign : {{.*}}, [[T0]] : $[[OPENED]] :
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
}

test/SILGen/generic_property_base_lifetime.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func getIntPropGeneric<T: ProtocolB>(_ a: T) -> Int {
9696
// CHECK: [[BORROWED_ARG:%.*]] = begin_borrow [[ARG]]
9797
// CHECK: [[PROJECTION:%.*]] = open_existential_ref [[BORROWED_ARG]]
9898
// CHECK: [[PROJECTION_COPY:%.*]] = copy_value [[PROJECTION]]
99-
// CHECK: [[METHOD:%.*]] = objc_method [[PROJECTION_COPY]] : $@opened({{.*}}) ProtocolO, #ProtocolO.intProp!getter.1.foreign : {{.*}}
99+
// CHECK: [[METHOD:%.*]] = witness_method [volatile] $@opened({{.*}}) ProtocolO, #ProtocolO.intProp!getter.1.foreign : {{.*}}, [[PROJECTION]]
100100
// CHECK: apply [[METHOD]]<@opened{{.*}}>([[PROJECTION_COPY]])
101101
// CHECK: destroy_value [[PROJECTION_COPY]]
102102
// CHECK: end_borrow [[BORROWED_ARG]] from [[ARG]]
@@ -111,7 +111,7 @@ func getIntPropExistential(_ a: ProtocolO) -> Int {
111111
// CHECK: [[BORROWED_ARG:%.*]] = begin_borrow [[ARG]]
112112
// CHECK: [[PROJECTION:%.*]] = open_existential_ref [[BORROWED_ARG]]
113113
// CHECK: [[PROJECTION_COPY:%.*]] = copy_value [[PROJECTION]]
114-
// CHECK: [[METHOD:%.*]] = objc_method [[PROJECTION_COPY]] : $@opened({{.*}}) ProtocolO, #ProtocolO.intProp!setter.1.foreign : {{.*}}
114+
// CHECK: [[METHOD:%.*]] = witness_method [volatile] $@opened({{.*}}) ProtocolO, #ProtocolO.intProp!setter.1.foreign : {{.*}}, [[PROJECTION]]
115115
// CHECK: apply [[METHOD]]<@opened{{.*}}>({{.*}}, [[PROJECTION_COPY]])
116116
// CHECK: destroy_value [[PROJECTION_COPY]]
117117
// CHECK: end_borrow [[BORROWED_ARG]] from [[ARG]]

0 commit comments

Comments
 (0)