aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/CodeGen')
-rw-r--r--backend/include/rcc/CodeGen/GlobalISel/LegalizationArtifactCombiner.h2
-rw-r--r--backend/include/rcc/CodeGen/MachineInstr.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/backend/include/rcc/CodeGen/GlobalISel/LegalizationArtifactCombiner.h b/backend/include/rcc/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
index c0c7be0..12225cf 100644
--- a/backend/include/rcc/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
+++ b/backend/include/rcc/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
@@ -351,7 +351,7 @@ private:
for (MachineInstr *Dead : DeadInstructions) {
if (Dead == nullptr || Dead->parent() == nullptr)
continue;
- auto Removed = Dead->parent()->removeInstruction(*Dead);
+ auto Removed = Dead->eraseFromParent();
if (!Removed)
return std::unexpected(Removed.error());
}
diff --git a/backend/include/rcc/CodeGen/MachineInstr.h b/backend/include/rcc/CodeGen/MachineInstr.h
index 6de4a4e..441f80d 100644
--- a/backend/include/rcc/CodeGen/MachineInstr.h
+++ b/backend/include/rcc/CodeGen/MachineInstr.h
@@ -79,6 +79,8 @@ public:
return ParentBlock != nullptr;
}
+ [[nodiscard]] Expected<void> eraseFromParent();
+
[[nodiscard]] bool isDebugInstr() const noexcept;
[[nodiscard]] std::size_t operandCount() const noexcept {