Skip to content

Commit df65ae2

Browse files
authored
Merge pull request #5635 from jckarter/alloc_box_with_box_type
SIL: Construct alloc_box insns with the type of the box.
2 parents 12fea93 + e1e7e19 commit df65ae2

File tree

103 files changed

+548
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+548
-517
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ class SILBuilder {
301301
getSILDebugLocation(Loc), valueType, operand, F, OpenedArchetypes));
302302
}
303303

304-
AllocBoxInst *createAllocBox(SILLocation Loc, SILType ElementType,
304+
AllocBoxInst *createAllocBox(SILLocation Loc, CanSILBoxType BoxType,
305305
SILDebugVariable Var = SILDebugVariable()) {
306306
Loc.markAsPrologue();
307-
return insert(AllocBoxInst::create(getSILDebugLocation(Loc), ElementType, F,
307+
return insert(AllocBoxInst::create(getSILDebugLocation(Loc), BoxType, F,
308308
OpenedArchetypes, Var));
309309
}
310310

include/swift/SIL/SILCloner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ SILCloner<ImplClass>::visitAllocBoxInst(AllocBoxInst *Inst) {
511511
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
512512
doPostProcess(Inst,
513513
getBuilder().createAllocBox(getOpLocation(Inst->getLoc()),
514-
getOpType(Inst->getElementType())));
514+
this->getOpType(Inst->getType()).template castTo<SILBoxType>()));
515515
}
516516

517517
template<typename ImplClass>

include/swift/SIL/SILInstruction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,11 @@ class AllocBoxInst final
863863

864864
TailAllocatedDebugVariable VarInfo;
865865

866-
AllocBoxInst(SILDebugLocation DebugLoc, SILType ElementType,
866+
AllocBoxInst(SILDebugLocation DebugLoc, CanSILBoxType BoxType,
867867
ArrayRef<SILValue> TypeDependentOperands, SILFunction &F,
868868
SILDebugVariable Var);
869869

870-
static AllocBoxInst *create(SILDebugLocation Loc, SILType elementType,
870+
static AllocBoxInst *create(SILDebugLocation Loc, CanSILBoxType boxType,
871871
SILFunction &F,
872872
SILOpenedArchetypesState &OpenedArchetypes,
873873
SILDebugVariable Var);

lib/Parse/ParseSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB, SILBuilder &B) {
16051605
return true;
16061606
if (parseSILDebugLocation(InstLoc, B))
16071607
return true;
1608-
ResultVal = B.createAllocBox(InstLoc, Ty, VarInfo);
1608+
ResultVal = B.createAllocBox(InstLoc, Ty.castTo<SILBoxType>(), VarInfo);
16091609
break;
16101610
}
16111611
case ValueKind::ApplyInst:

lib/SIL/SILInstructions.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,29 +224,29 @@ AllocRefDynamicInst::create(SILDebugLocation DebugLoc, SILFunction &F,
224224
AllocRefDynamicInst(DebugLoc, ty, objc, ElementTypes, AllOperands);
225225
}
226226

227-
AllocBoxInst::AllocBoxInst(SILDebugLocation Loc, SILType ElementType,
227+
AllocBoxInst::AllocBoxInst(SILDebugLocation Loc, CanSILBoxType BoxType,
228228
ArrayRef<SILValue> TypeDependentOperands,
229229
SILFunction &F, SILDebugVariable Var)
230230
: AllocationInst(ValueKind::AllocBoxInst, Loc,
231-
SILType::getPrimitiveObjectType(
232-
SILBoxType::get(ElementType.getSwiftRValueType()))),
231+
SILType::getPrimitiveObjectType(BoxType)),
233232
NumOperands(TypeDependentOperands.size()),
234233
VarInfo(Var, getTrailingObjects<char>()) {
235234
TrailingOperandsList::InitOperandsList(getAllOperands().begin(), this,
236235
TypeDependentOperands);
237236
}
238237

239-
AllocBoxInst *AllocBoxInst::create(SILDebugLocation Loc, SILType ElementType,
238+
AllocBoxInst *AllocBoxInst::create(SILDebugLocation Loc,
239+
CanSILBoxType BoxType,
240240
SILFunction &F,
241241
SILOpenedArchetypesState &OpenedArchetypes,
242242
SILDebugVariable Var) {
243243
SmallVector<SILValue, 8> TypeDependentOperands;
244244
collectTypeDependentOperands(TypeDependentOperands, OpenedArchetypes, F,
245-
ElementType.getSwiftRValueType());
245+
BoxType);
246246
void *Buffer = allocateDebugVarCarryingInst<AllocBoxInst>(
247247
F.getModule(), Var, TypeDependentOperands);
248248
return ::new (Buffer)
249-
AllocBoxInst(Loc, ElementType, TypeDependentOperands, F, Var);
249+
AllocBoxInst(Loc, BoxType, TypeDependentOperands, F, Var);
250250
}
251251

252252
/// getDecl - Return the underlying variable declaration associated with this

lib/SIL/SILPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ class SILPrinter : public SILVisitor<SILPrinter> {
883883
}
884884

885885
void visitAllocBoxInst(AllocBoxInst *ABI) {
886-
*this << ABI->getElementType();
886+
*this << ABI->getType();
887887
printDebugVar(ABI->getVarInfo());
888888
}
889889

lib/SILGen/SILGenApply.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3866,7 +3866,8 @@ ManagedValue SILGenFunction::emitInjectEnum(SILLocation loc,
38663866
// throws, we know to deallocate the uninitialized box.
38673867
if (element->isIndirect() ||
38683868
element->getParentEnum()->isIndirect()) {
3869-
auto *box = B.createAllocBox(loc, payloadTL.getLoweredType());
3869+
auto boxTy = SILBoxType::get(payloadTL.getLoweredType().getSwiftRValueType());
3870+
auto *box = B.createAllocBox(loc, boxTy);
38703871
auto *addr = B.createProjectBox(loc, box, 0);
38713872

38723873
CleanupHandle initCleanup = enterDestroyCleanup(box);

lib/SILGen/SILGenDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,12 @@ class LocalVariableInitialization : public SingleBufferInitialization {
282282
assert(!SGF.VarLocs.count(decl) && "Already have an entry for this decl?");
283283

284284
SILType lType = SGF.getLoweredType(decl->getType()->getRValueType());
285+
auto boxType = SILBoxType::get(lType.getSwiftRValueType());
285286

286287
// The variable may have its lifetime extended by a closure, heap-allocate
287288
// it using a box.
288289
AllocBoxInst *allocBox =
289-
SGF.B.createAllocBox(decl, lType, {decl->isLet(), ArgNo});
290+
SGF.B.createAllocBox(decl, boxType, {decl->isLet(), ArgNo});
290291
SILValue addr = SGF.B.createProjectBox(decl, allocBox, 0);
291292

292293
// Mark the memory as uninitialized, so DI will track it for us.

lib/SILGen/SILGenFunction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,9 @@ void SILGenFunction::emitCaptures(SILLocation loc,
336336
// since we could conceivably forward the copied value into the
337337
// closure context and pass it down to the partially applied function
338338
// in-place.
339-
AllocBoxInst *allocBox =
340-
B.createAllocBox(loc, vl.value->getType().getObjectType());
339+
auto boxTy = SILBoxType::get(vl.value->getType().getSwiftRValueType());
340+
341+
AllocBoxInst *allocBox = B.createAllocBox(loc, boxTy);
341342
ProjectBoxInst *boxAddress = B.createProjectBox(loc, allocBox, 0);
342343
B.createCopyAddr(loc, vl.value, boxAddress, IsNotTake,IsInitialization);
343344
capturedArgs.push_back(emitManagedRValueWithCleanup(allocBox));

lib/Serialization/DeserializeSIL.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,18 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
778778
case ValueKind::DebugValueAddrInst:
779779
llvm_unreachable("not supported");
780780

781+
case ValueKind::AllocBoxInst:
782+
assert(RecordKind == SIL_ONE_TYPE && "Layout should be OneType.");
783+
ResultVal = Builder.createAllocBox(Loc,
784+
cast<SILBoxType>(MF->getType(TyID)->getCanonicalType()));
785+
break;
786+
781787
#define ONETYPE_INST(ID) \
782788
case ValueKind::ID##Inst: \
783789
assert(RecordKind == SIL_ONE_TYPE && "Layout should be OneType."); \
784790
ResultVal = Builder.create##ID(Loc, \
785791
getSILType(MF->getType(TyID), (SILValueCategory)TyCategory));\
786792
break;
787-
ONETYPE_INST(AllocBox)
788793
ONETYPE_INST(AllocStack)
789794
ONETYPE_INST(Metatype)
790795
#undef ONETYPE_INST

lib/Serialization/SerializeSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
650650
}
651651
case ValueKind::AllocBoxInst: {
652652
const AllocBoxInst *ABI = cast<AllocBoxInst>(&SI);
653-
writeOneTypeLayout(ABI->getKind(), ABI->getElementType());
653+
writeOneTypeLayout(ABI->getKind(), ABI->getType());
654654
break;
655655
}
656656
case ValueKind::AllocRefInst:

test/IRGen/dynamic_lookup.sil

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ bb0(%0 : $X):
5454
// CHECK: define{{( protected)?}} void @dynamic_lookup_br(%objc_object*)
5555
sil @dynamic_lookup_br : $@convention(thin) (AnyObject) -> () {
5656
bb0(%0 : $AnyObject):
57-
%1 = alloc_box $AnyObject
57+
%1 = alloc_box $@box AnyObject
5858
%1a = project_box %1 : $@box AnyObject, 0
5959
store %0 to %1a : $*AnyObject
60-
%3 = alloc_box $Optional<() -> ()>
60+
%3 = alloc_box $@box Optional<() -> ()>
6161
%4 = load %1a : $*AnyObject
6262
strong_retain %4 : $AnyObject
6363
%6 = open_existential_ref %4 : $AnyObject to $@opened("01234567-89ab-cdef-0123-000000000000") AnyObject
@@ -103,7 +103,7 @@ bb3:
103103

104104
sil @_T1t23dynamic_lookup_propertyFT1xPSo13AnyObject__T_ : $@convention(thin) (AnyObject) -> () {
105105
bb0(%0 : $AnyObject):
106-
%1 = alloc_box $AnyObject
106+
%1 = alloc_box $@box AnyObject
107107
%1a = project_box %1 : $@box AnyObject, 0
108108
store %0 to %1a : $*AnyObject
109109
%6 = load %1a : $*AnyObject // users: %24, %8, %7
@@ -126,9 +126,9 @@ bb3:
126126
// CHECK-LABEL: define{{( protected)?}} void @_T1t16opt_to_subscriptFT3objPSo13AnyObject_1iSi_T_(%objc_object*, {{(i32|i64)}})
127127
sil @_T1t16opt_to_subscriptFT3objPSo13AnyObject_1iSi_T_ : $@convention(thin) (AnyObject, Int) -> () {
128128
bb0(%0 : $AnyObject, %1 : $Int):
129-
%2 = alloc_box $AnyObject
129+
%2 = alloc_box $@box AnyObject
130130
%2a = project_box %2 : $@box AnyObject, 0
131-
%3 = alloc_box $Int
131+
%3 = alloc_box $@box Int
132132
%3a = project_box %3 : $@box Int, 0
133133
store %0 to %2a : $*AnyObject
134134
store %1 to %3a : $*Int

test/IRGen/partial_apply.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ sil @empty_box : $@convention(thin) () -> () {
559559
entry:
560560
// CHECK: store %swift.refcounted* null
561561
// CHECK: store %swift.opaque* undef
562-
%b = alloc_box $()
562+
%b = alloc_box $@box ()
563563
%ba = project_box %b : $@box (), 0
564564
%f = function_ref @partial_empty_box : $@convention(thin) (@owned @box (), @inout ()) -> ()
565565
%g = partial_apply %f(%b, %ba) : $@convention(thin) (@owned @box (), @inout ()) -> ()

test/IRGen/typed_boxes.sil

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Builtin
88
sil @pod_box_8_8_a : $@convention(thin) () -> () {
99
entry:
1010
// CHECK: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[POD_8_8_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD:i[0-9]+]] 24, [[WORD]] 7)
11-
%a = alloc_box $Builtin.Int64
11+
%a = alloc_box $@box Builtin.Int64
1212
// CHECK-32: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[4 x i8\], \[8 x i8\] \}>]]*
1313
// CHECK-32: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], [[POD_8_8_LAYOUT]]* [[BOX_RAW]], i32 0, i32 2
1414
// CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]]*
@@ -24,7 +24,7 @@ entry:
2424
sil @pod_box_8_8_b : $@convention(thin) () -> () {
2525
entry:
2626
// CHECK: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[POD_8_8_METADATA]], {{.*}} [[WORD]] 24, [[WORD]] 7)
27-
%a = alloc_box $Builtin.FPIEEE64
27+
%a = alloc_box $@box Builtin.FPIEEE64
2828
// CHECK-32: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[4 x i8\], \[8 x i8\] \}>]]*
2929
// CHECK-32: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], [[POD_8_8_LAYOUT]]* [[BOX_RAW]], i32 0, i32 2
3030
// CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]]*
@@ -45,7 +45,7 @@ struct OverAligned {
4545
sil @pod_box_32_32 : $@convention(thin) () -> () {
4646
entry:
4747
// CHECK: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[POD_32_32_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 64, [[WORD]] 31)
48-
%a = alloc_box $OverAligned
48+
%a = alloc_box $@box OverAligned
4949
// CHECK-32: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_32_32_LAYOUT:<\{ %swift.refcounted, \[20 x i8\], \[32 x i8\] \}>]]*
5050
// CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_32_32_LAYOUT:<\{ %swift.refcounted, \[16 x i8\], \[32 x i8\] \}>]]*
5151
// CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_32_32_LAYOUT]], [[POD_32_32_LAYOUT]]* [[BOX_RAW]], i32 0, i32 2
@@ -67,7 +67,7 @@ sil @rc_box_a : $@convention(thin) () -> () {
6767
entry:
6868
// CHECK-32: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 16, [[WORD]] 3)
6969
// CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 24, [[WORD]] 7)
70-
%a = alloc_box $C
70+
%a = alloc_box $@box C
7171
// CHECK: bitcast %swift.refcounted** {{%.*}} to %C11typed_boxes1C**
7272
%b = project_box %a : $@box C, 0
7373
dealloc_box %a : $@box C
@@ -80,7 +80,7 @@ entry:
8080
// TODO: Should reuse metadata
8181
// CHECK-32: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA]], {{.*}} [[WORD]] 16, [[WORD]] 3)
8282
// CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA]], {{.*}} [[WORD]] 24, [[WORD]] 7)
83-
%a = alloc_box $D
83+
%a = alloc_box $@box D
8484
// CHECK: bitcast %swift.refcounted** {{%.*}} to %C11typed_boxes1D**
8585
%b = project_box %a : $@box D, 0
8686
dealloc_box %a : $@box D
@@ -92,7 +92,7 @@ sil @unknown_rc_box : $@convention(thin) () -> () {
9292
entry:
9393
// CHECK-32: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[UNKNOWN_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 16, [[WORD]] 3)
9494
// CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[UNKNOWN_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 24, [[WORD]] 7)
95-
%a = alloc_box $Builtin.UnknownObject
95+
%a = alloc_box $@box Builtin.UnknownObject
9696
%b = project_box %a : $@box Builtin.UnknownObject, 0
9797
dealloc_box %a : $@box Builtin.UnknownObject
9898
return undef : $()
@@ -106,7 +106,7 @@ struct Fixed {
106106

107107
sil @fixed_box : $@convention(thin) () -> () {
108108
entry:
109-
%a = alloc_box $Fixed
109+
%a = alloc_box $@box Fixed
110110
%b = project_box %a : $@box Fixed, 0
111111
dealloc_box %a : $@box Fixed
112112
return undef : $()
@@ -128,7 +128,7 @@ entry:
128128
// CHECK: [[ALLOC:%.*]] = call { %swift.refcounted*, %swift.opaque* } @swift_allocBox(%swift.type* [[METADATA]])
129129
// CHECK: [[BOX:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 0
130130
// CHECK: [[PTR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 1
131-
%a = alloc_box $Dyn<T>
131+
%a = alloc_box $@box Dyn<T>
132132
// CHECK: [[CAST_PTR:%.*]] = bitcast %swift.opaque* [[PTR]] to %V11typed_boxes3Dyn*
133133
%b = project_box %a : $@box Dyn<T>, 0
134134
%f = function_ref @take_dyn : $@convention(thin) <T> (@in Dyn<T>) -> ()
@@ -145,7 +145,7 @@ entry:
145145
// CHECK: [[ALLOC:%.*]] = call { %swift.refcounted*, %swift.opaque* } @swift_allocBox(%swift.type* %T)
146146
// CHECK: [[BOX:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 0
147147
// CHECK: [[PTR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 1
148-
%a = alloc_box $T
148+
%a = alloc_box $@box T
149149
%b = project_box %a : $@box T, 0
150150
%f = function_ref @take_t : $@convention(thin) <T> (@in T) -> ()
151151
// CHECK: call void @take_t(%swift.opaque* {{[^,]*}} [[PTR]], {{.*}})

test/Reflection/box_descriptors.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class C<T> {}
1616
sil_vtable C {}
1717

1818
sil @make_some_boxes : $@convention(thin) <T> () -> (@box Int, @box (Int, Int), @box C<T>) {
19-
%a = alloc_box $Int
20-
%b = alloc_box $(Int, Int)
21-
%c = alloc_box $C<T>
19+
%a = alloc_box $@box Int
20+
%b = alloc_box $@box (Int, Int)
21+
%c = alloc_box $@box C<T>
2222
%result = tuple (%a : $@box Int, %b : $@box (Int, Int), %c : $@box C<T>)
2323
return %result : $(@box Int, @box (Int, Int), @box C<T>)
2424
}

test/Reflection/capture_descriptors.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bb0(%i: $Int, %b: $@box Int, %m: $@thin Int.Type, %p: $@thick P.Type):
2424
sil @concrete_caller1 : $@convention(thin) (Int, @thick P.Type) -> @owned @callee_owned () -> () {
2525
bb0(%i: $Int, %p: $@thick P.Type):
2626
%f = function_ref @concrete_callee1 : $@convention(thin) (Int, @owned @box Int, @thin Int.Type, @thick P.Type) -> ()
27-
%b = alloc_box $Int
27+
%b = alloc_box $@box Int
2828
%m = metatype $@thin Int.Type
2929
%c = partial_apply %f(%i, %b, %m, %p) : $@convention(thin) (Int, @owned @box Int, @thin Int.Type, @thick P.Type) -> ()
3030
return %c : $@callee_owned () -> ()
@@ -60,7 +60,7 @@ sil @concrete_caller2 : $@convention(thin) () -> @owned @callee_owned () -> () {
6060
bb0:
6161
%f = function_ref @generic_callee2 : $@convention(thin) <T, U> (@in T, @owned @box U) -> ()
6262
%i = alloc_stack $Int
63-
%b = alloc_box $String
63+
%b = alloc_box $@box String
6464
%c = partial_apply %f<Int, String>(%i, %b) : $@convention(thin) <T, U> (@in T, @owned @box U) -> ()
6565
dealloc_stack %i : $*Int
6666
return %c : $@callee_owned () -> ()

test/SIL/Parser/apply_with_substitution.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Swift
99
// CHECK-LABEL: sil @_TF4test3fooFT1fGSqFT_T___T_ : $@convention(thin) (@owned Optional<@callee_owned (@in ()) -> @out ()>) -> ()
1010
sil @_TF4test3fooFT1fGSqFT_T___T_ : $@convention(thin) (@owned Optional<@callee_owned (@in ()) -> @out ()>) -> () {
1111
bb0(%0 : $Optional<@callee_owned (@in ()) -> @out ()>):
12-
%1 = alloc_box $Optional<@callee_owned (@in ()) -> @out ()> // var f // users: %2, %6, %32
12+
%1 = alloc_box $@box Optional<@callee_owned (@in ()) -> @out ()> // var f // users: %2, %6, %32
1313
%1a = project_box %1 : $@box Optional<@callee_owned (@in ()) -> @out ()>, 0
1414
store %0 to %1a : $*Optional<@callee_owned (@in ()) -> @out ()> // id: %2
1515
%3 = alloc_stack $Optional<()> // users: %22, %28, %30, %31

0 commit comments

Comments
 (0)