diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -2487,11 +2487,10 @@ // "blocks that are potentially in scope. See comment at start of vlocJoin. SmallPtrSet InScopeBlocks = BlocksToExplore; - // Old LiveDebugValues tracks variable locations that come out of blocks - // not in scope, where DBG_VALUEs occur. This is something we could - // legitimately ignore, but lets allow it for now. - if (EmulateOldLDV) - BlocksToExplore.insert(AssignBlocks.begin(), AssignBlocks.end()); + // VarLoc LiveDebugValues tracks variable locations that are defined in + // blocks not in scope. This is something we could legitimately ignore, but + // lets allow it for now for the sake of coverage. + BlocksToExplore.insert(AssignBlocks.begin(), AssignBlocks.end()); // We also need to propagate variable values through any artificial blocks // that immediately follow blocks in scope. diff --git a/llvm/test/DebugInfo/X86/stack-value-dwarf2.ll b/llvm/test/DebugInfo/X86/stack-value-dwarf2.ll --- a/llvm/test/DebugInfo/X86/stack-value-dwarf2.ll +++ b/llvm/test/DebugInfo/X86/stack-value-dwarf2.ll @@ -1,4 +1,4 @@ -; RUN: llc -filetype=obj -o - %s -experimental-debug-variable-locations=false | llvm-dwarfdump -debug-loc - | FileCheck %s +; RUN: llc -filetype=obj -o - %s -experimental-debug-variable-locations=true | llvm-dwarfdump -debug-loc - | FileCheck %s ; Note that it would be even better to avoid emitting the empty piece. ; CHECK: {{.*}}: DW_OP_piece 0x8{{$}}