Skip to content

Commit 26d4904

Browse files
authored
Merge pull request #10837 from gottesmm/semantic_sil_init_block_storage_header
2 parents de0d0ba + fc58369 commit 26d4904

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/SIL/ValueOwnershipKindClassifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ CONSTANT_OWNERSHIP_INST(Trivial, FunctionRef)
7272
CONSTANT_OWNERSHIP_INST(Trivial, GlobalAddr)
7373
CONSTANT_OWNERSHIP_INST(Trivial, IndexAddr)
7474
CONSTANT_OWNERSHIP_INST(Trivial, IndexRawPointer)
75-
CONSTANT_OWNERSHIP_INST(Trivial, InitBlockStorageHeader)
7675
CONSTANT_OWNERSHIP_INST(Trivial, InitEnumDataAddr)
7776
CONSTANT_OWNERSHIP_INST(Trivial, InitExistentialAddr)
7877
CONSTANT_OWNERSHIP_INST(Trivial, InitExistentialMetatype)
@@ -115,6 +114,7 @@ CONSTANT_OWNERSHIP_INST(Trivial, UnconditionalCheckedCastAddr)
115114
CONSTANT_OWNERSHIP_INST(Trivial, ValueMetatype)
116115
CONSTANT_OWNERSHIP_INST(Trivial, WitnessMethod)
117116
CONSTANT_OWNERSHIP_INST(Trivial, StoreBorrow)
117+
CONSTANT_OWNERSHIP_INST(Unowned, InitBlockStorageHeader)
118118
// TODO: It would be great to get rid of these.
119119
CONSTANT_OWNERSHIP_INST(Unowned, RawPointerToRef)
120120
CONSTANT_OWNERSHIP_INST(Unowned, RefToUnowned)

test/SIL/ownership-verifier/use_verifier.sil

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,19 @@ bb0:
357357
return %0 : $Optional<Builtin.NativeObject>
358358
}
359359

360+
sil @c_function : $@convention(c) (@inout_aliasable @block_storage @callee_owned () -> ()) -> ()
361+
362+
sil @test_block_storage : $@convention(thin) () -> () {
363+
bb0:
364+
%0 = function_ref @c_function : $@convention(c) (@inout_aliasable @block_storage @callee_owned () -> ()) -> ()
365+
%1 = alloc_stack $@block_storage @callee_owned () -> ()
366+
%2 = project_block_storage %1 : $*@block_storage @callee_owned () -> ()
367+
%3 = init_block_storage_header %1 : $*@block_storage @callee_owned () -> (), invoke %0 : $@convention(c) (@inout_aliasable @block_storage @callee_owned () -> ()) -> (), type $@convention(block) () -> ()
368+
dealloc_stack %1 : $*@block_storage @callee_owned () -> ()
369+
%9999 = tuple()
370+
return %9999 : $()
371+
}
372+
360373
//////////////////////
361374
// Terminator Tests //
362375
//////////////////////

0 commit comments

Comments
 (0)