aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 13:09:30 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 13:09:30 +0800
commit8553df97bbc6154dae9d0ad861857e71a0efa420 (patch)
tree754fa62b6181e96ed60f1f918c4ee44229d4e0d7 /backend/include/rcc/CodeGen/MachineInstr.h
parentb4d1ddb99e1305f6ea6217e7570dda2a94b16e51 (diff)
downloadrcc-project-8553df97bbc6154dae9d0ad861857e71a0efa420.tar.gz
rcc-project-8553df97bbc6154dae9d0ad861857e71a0efa420.tar.xz
[CodeGen] Add transactional MachineIR builder
Validate insertion cursors, operand ownership, descriptor constraints, ties, implicit registers, and memory operands before allocating or publishing an instruction. Share instruction legality checks with the verifier path and preserve deterministic insertion order.
Diffstat (limited to 'backend/include/rcc/CodeGen/MachineInstr.h')
-rw-r--r--backend/include/rcc/CodeGen/MachineInstr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/include/rcc/CodeGen/MachineInstr.h b/backend/include/rcc/CodeGen/MachineInstr.h
index 376273f..bcae306 100644
--- a/backend/include/rcc/CodeGen/MachineInstr.h
+++ b/backend/include/rcc/CodeGen/MachineInstr.h
@@ -87,8 +87,8 @@ public:
}
void reserveOperands(std::size_t Capacity);
- [[nodiscard]] Expected<void> addOperand(MachineOperand Operand);
- [[nodiscard]] Expected<void> insertOperand(std::size_t Index, MachineOperand Operand);
+ [[nodiscard]] Expected<void> addOperand(MachineOperand &&Operand);
+ [[nodiscard]] Expected<void> insertOperand(std::size_t Index, MachineOperand &&Operand);
[[nodiscard]] Expected<void> eraseOperand(std::size_t Index);
[[nodiscard]] Expected<void> tieOperands(std::size_t DefIndex, std::size_t UseIndex);