File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ bool StackNesting::solve() {
153
153
static SILInstruction *createDealloc (AllocationInst *Alloc,
154
154
SILInstruction *InsertionPoint,
155
155
SILLocation Location) {
156
- SILBuilder B (InsertionPoint);
156
+ SILBuilderWithScope B (InsertionPoint);
157
157
switch (Alloc->getKind ()) {
158
158
case SILInstructionKind::AllocStackInst:
159
159
return B.createDeallocStack (Location, Alloc);
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-sil -enable-sil-ownership %s -Onone -Xllvm \
2
+ // RUN: -sil-print-after=allocbox-to-stack -Xllvm \
3
+ // RUN: -sil-print-only-functions=$S3red19ThrowAddrOnlyStructV016throwsOptionalToG0ACyxGSgSi_tcfC \
4
+ // RUN: -Xllvm -sil-print-debuginfo -o /dev/null 2>&1 | %FileCheck %s
5
+
6
+ // CHECK: bb5(%27 : @owned $Error):
7
+ // CHECK: dealloc_stack %6 : $*ThrowAddrOnlyStruct<T>, loc {{.*}}:27:68, scope 2
8
+ // CHECK: dealloc_stack %3 : $*ThrowAddrOnlyStruct<T>, loc {{.*}}:27:68, scope 2
9
+ // CHECK: br bb4(%27 : $Error), loc {{.*}}:27:15, scope 2
10
+
11
+ protocol Patatino {
12
+ init ( )
13
+ }
14
+ struct ThrowAddrOnlyStruct < T : Patatino > {
15
+ var x : T
16
+ init ( fail: ( ) ) throws { x = T ( ) }
17
+ init ( failDuringDelegation: Int ) throws {
18
+ try self . init ( fail: ( ) )
19
+ }
20
+ init ? ( throwsToOptional: Int ) {
21
+ try ? self . init ( failDuringDelegation: throwsToOptional)
22
+ }
23
+ init ( throwsOptionalToThrows: Int ) throws {
24
+ self . init ( throwsToOptional: throwsOptionalToThrows) !
25
+ }
26
+ init ? ( throwsOptionalToOptional: Int ) {
27
+ try ! self . init ( throwsOptionalToThrows: throwsOptionalToOptional)
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments