aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-07-26 19:03:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-07-26 19:04:23 +0000
commit7fa27ce4a07f19b07799a767fc29416f3b625afb (patch)
tree27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp
index 9a6acd157a74..f3f54a5fb501 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp
@@ -65,14 +65,14 @@ FunctionPass *llvm::createWebAssemblyDebugFixup() {
// Because Wasm cannot access values in LLVM virtual registers in the debugger,
// these dangling DBG_VALUEs in effect kill the effect of any previous DBG_VALUE
// associated with the variable, which will appear as "optimized out".
-static void nullifyDanglingDebugValues(MachineBasicBlock &MBB,
- const TargetInstrInfo *TII) {
+static void setDanglingDebugValuesUndef(MachineBasicBlock &MBB,
+ const TargetInstrInfo *TII) {
for (auto &MI : llvm::make_early_inc_range(MBB)) {
if (MI.isDebugValue() && MI.getDebugOperand(0).isReg() &&
!MI.isUndefDebugValue()) {
- LLVM_DEBUG(dbgs() << "Warning: dangling DBG_VALUE nullified: " << MI
+ LLVM_DEBUG(dbgs() << "Warning: dangling DBG_VALUE set to undef: " << MI
<< "\n");
- MI.getDebugOperand(0).setReg(Register());
+ MI.setDebugValueUndef();
}
}
}
@@ -154,7 +154,7 @@ bool WebAssemblyDebugFixup::runOnMachineFunction(MachineFunction &MF) {
assert(Stack.empty() &&
"WebAssemblyDebugFixup: Stack not empty at end of basic block!");
- nullifyDanglingDebugValues(MBB, TII);
+ setDanglingDebugValuesUndef(MBB, TII);
}
return true;