[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:
Nate Chandler
2024-03-08 21:12:00 -08:00
parent 08a832b803
commit a54a8ddaa3
5 changed files with 24 additions and 19 deletions

View File

@@ -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) {