mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SIL] Key consume addr checking off var_decl attr.
Previously, the lexical attribute on allock_stack instructions was used. This doesn't work for values without lexical lifetimes which are consumed, e.g. stdlib CoW types. Here, the new var_decl attribute on alloc_stack is keyed off of instead. This flag encodes exactly that a value corresponds to a source-level VarDecl, which is the condition under which checking needs to run.
This commit is contained in:
@@ -28,7 +28,7 @@ func use<T>(_ t : T) {}
|
||||
// CHECK-SIL: sil hidden @$s16debug_value_addr11GenericSelfV1xACyxGx_tcfC : $@convention(method) <T> (@in T, @thin GenericSelf<T>.Type) -> GenericSelf<T> {
|
||||
// CHECK-SIL: bb0(%0 : $*T, %1 : $@thin GenericSelf<T>.Type):
|
||||
//
|
||||
// CHECK-SIL-NEXT: alloc_stack $GenericSelf<T>, var, name "self", implicit, loc {{.*}}
|
||||
// CHECK-SIL-NEXT: alloc_stack [var_decl] $GenericSelf<T>, var, name "self", implicit, loc {{.*}}
|
||||
// CHECK-SIL-NEXT: debug_value %0 : $*T, let, name "x", argno 1, expr op_deref, loc {{.*}}
|
||||
struct GenericSelf<T> {
|
||||
init(x: T) {
|
||||
|
||||
Reference in New Issue
Block a user