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/MachineSink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/lib/CodeGen/MachineSink.cpp') diff --git a/backend/lib/CodeGen/MachineSink.cpp b/backend/lib/CodeGen/MachineSink.cpp index dda2048..f82f3a7 100644 --- a/backend/lib/CodeGen/MachineSink.cpp +++ b/backend/lib/CodeGen/MachineSink.cpp @@ -327,7 +327,7 @@ findPostRADestination(MachineInstr &Instruction, const MachineFunction &Function MachineBasicBlock *Source = Instruction.parent(); if (Source == nullptr || Destination.Block == nullptr || Destination.FirstUse == nullptr) return makeUnexpected(ErrorCode::InternalError, "machine sink has an invalid move plan"); - auto Removed = Source->removeInstruction(Instruction); + auto Removed = Instruction.eraseFromParent(); if (!Removed) return std::unexpected(Removed.error()); return Destination.Block->insertInstructionBefore(*Destination.FirstUse, Instruction); -- cgit v1.2.3