Skip to content

Commit

Permalink
Revert "[DebugInfo] Variables with only empty values emitting when on…
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Dec 24, 2022
1 parent 653a9fb commit 83d4851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool DbgValueHistoryMap::hasNonEmptyLocation(const Entries &Entries) const {
const MachineInstr *MI = Entry.getInstr();
assert(MI->isDebugValue());
// A DBG_VALUE $noreg is an empty variable location
if (MI->isUndefDebugValue())
if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == 0)
continue;

return true;
Expand Down
4 changes: 3 additions & 1 deletion llvm/test/DebugInfo/X86/dbg_value_list_emission.mir
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ body: |
; (8) Check that a single $noreg location invalidates the entire entry.
DBG_VALUE_LIST !30, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $eax, $noreg, debug-location !15
; CHECK-NOT: DW_AT_name ("localh")
; CHECK: DW_TAG_variable
; CHECK-NEXT: DW_AT_name ("localh")
; CHECK-NOT: DW_AT_location
RET64 debug-location !15
...

0 comments on commit 83d4851

Please sign in to comment.