diff options
Diffstat (limited to 'backend/lib/CodeGen/MachineInstr.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineInstr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/MachineInstr.cpp b/backend/lib/CodeGen/MachineInstr.cpp index 55b4ce9..3b200c5 100644 --- a/backend/lib/CodeGen/MachineInstr.cpp +++ b/backend/lib/CodeGen/MachineInstr.cpp @@ -43,6 +43,12 @@ Expected<void> MachineInstr::setOpcode(Opcode NewOpcode) { return {}; } +Expected<void> MachineInstr::eraseFromParent() { + if (ParentBlock == nullptr) + return makeUnexpected(ErrorCode::InternalError, "cannot erase a detached machine instruction"); + return ParentBlock->removeInstruction(*this); +} + Expected<void> MachineInstr::setDebugInstrNumber(std::uint64_t Number) { if (Number == 0 || Number > std::numeric_limits<std::uint32_t>::max()) { return makeUnexpected(ErrorCode::InvalidArgument, |
