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:
@@ -2475,8 +2475,8 @@ class ConsumeOperatorCopyableAddressesCheckerPass
|
||||
++ii;
|
||||
|
||||
if (auto *asi = dyn_cast<AllocStackInst>(inst)) {
|
||||
// Only check lexical alloc_stack that were not emitted as vars.
|
||||
if (asi->isLexical()) {
|
||||
// Only check var_decl alloc_stack insts.
|
||||
if (asi->isFromVarDecl()) {
|
||||
LLVM_DEBUG(llvm::dbgs() << "Found lexical alloc_stack: " << *asi);
|
||||
addressesToCheck.insert(asi);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user