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

Tanya Brethour tbrethou at cs.uiuc.edu
Sun May 23 22:16:12 PDT 2004


Changes in directory llvm/lib/CodeGen:

MachineInstr.cpp updated: 1.98 -> 1.99

---
Log message:

Changed clone to be const.
Changed copy constructor to set parent, prev, and next pointers to null.


---
Diffs of the changes:  (+7 -1)

Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.98 llvm/lib/CodeGen/MachineInstr.cpp:1.99
--- llvm/lib/CodeGen/MachineInstr.cpp:1.98	Sun May 23 15:57:57 2004
+++ llvm/lib/CodeGen/MachineInstr.cpp	Sun May 23 22:14:16 2004
@@ -78,6 +78,12 @@
   //Add operands
   for(unsigned i=0; i < MI.getNumOperands(); ++i)
     operands.push_back(MachineOperand(MI.getOperand(i)));
+
+  //Set parent, next, and prev to null
+  parent = 0;
+  prev = 0;
+  next = 0;
+  
 }
 
 
@@ -89,7 +95,7 @@
 ///clone - Create a copy of 'this' instruction that is identical in
 ///all ways except the following: The instruction has no parent The
 ///instruction has no name
-MachineInstr* MachineInstr::clone() {
+MachineInstr* MachineInstr::clone() const {
   return new MachineInstr(*this);
 }
 





More information about the llvm-commits mailing list