From e72ad2cd524ff38f162a23d69da5f78494d337ae Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Fri, 28 Aug 2026 13:45:07 +0800 Subject: [CodeGen] Centralize machine instruction erasure --- backend/lib/CodeGen/MachineStripDebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/lib/CodeGen/MachineStripDebug.cpp') 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 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; -- cgit v1.2.3