[llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp

Vikram Adve vadve at psmith.cs.uiuc.edu
Thu Sep 19 19:48:00 PDT 2002


Changes in directory llvm/lib/CodeGen/InstrSelection:

MachineInstr.cpp updated: 1.46 -> 1.47

---
Log message:

Add method MachineInstr::replace to rewrite a machine instruction in place.


---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp
diff -u llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.46 llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.47
--- llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.46	Mon Sep 16 10:18:53 2002
+++ llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp	Thu Sep 19 19:47:37 2002
@@ -27,6 +27,22 @@
 {
 }
 
+// 
+// Support for replacing opcode and operands of a MachineInstr in place.
+// This only resets the size of the operand vector and initializes it.
+// The new operands must be set explicitly later.
+// 
+void
+MachineInstr::replace(MachineOpCode _opCode,
+                      unsigned	    numOperands,
+                      OpCodeMask    _opCodeMask)
+{
+  opCode = _opCode;
+  opCodeMask = _opCodeMask;
+  operands.clear();
+  operands.resize(numOperands);
+}
+
 void
 MachineInstr::SetMachineOperandVal(unsigned int i,
                                    MachineOperand::MachineOperandType opType,





More information about the llvm-commits mailing list