[llvm] [NFC][LLVM] Refactor MachineInstr operand accessors (PR #137261)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 07:00:53 PDT 2025


================
@@ -676,68 +672,61 @@ class MachineInstr
   const_mop_iterator operands_begin() const { return Operands; }
   const_mop_iterator operands_end() const { return Operands + NumOperands; }
 
-  iterator_range<mop_iterator> operands() {
-    return make_range(operands_begin(), operands_end());
+  MutableArrayRef<MachineOperand> operands() {
----------------
s-barannikov wrote:

What does this change simplify?
Exposing internal storage type makes it difficult to change the storage type in the future.


https://github.com/llvm/llvm-project/pull/137261


More information about the llvm-commits mailing list