aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineStripDebug.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 13:45:07 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 13:45:07 +0800
commite72ad2cd524ff38f162a23d69da5f78494d337ae (patch)
tree2e590806b0f610e4392f25f6e8cdff57d2f5a929 /backend/lib/CodeGen/MachineStripDebug.cpp
parent3b14bd4d5324b5a280c1ee5567b5526b59e60c5b (diff)
downloadrcc-project-e72ad2cd524ff38f162a23d69da5f78494d337ae.tar.gz
rcc-project-e72ad2cd524ff38f162a23d69da5f78494d337ae.tar.xz
[CodeGen] Centralize machine instruction erasure
Diffstat (limited to 'backend/lib/CodeGen/MachineStripDebug.cpp')
-rw-r--r--backend/lib/CodeGen/MachineStripDebug.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/lib/CodeGen/MachineStripDebug.cpp b/backend/lib/CodeGen/MachineStripDebug.cpp
index 4699ef0..46d92d1 100644
--- a/backend/lib/CodeGen/MachineStripDebug.cpp
+++ b/backend/lib/CodeGen/MachineStripDebug.cpp
@@ -14,7 +14,7 @@ Expected<bool> stripDebugMachineFunction(MachineFunction &Function) {
for (MachineInstr *Instruction = Block->firstInstruction(); Instruction != nullptr;) {
MachineInstr *Next = Instruction->next();
if (Instruction->isDebugInstr() && Instruction->operandCount() > 1) {
- auto Removed = Block->removeInstruction(*Instruction);
+ auto Removed = Instruction->eraseFromParent();
if (!Removed)
return std::unexpected(Removed.error());
Changed = true;