[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h
Tanya Brethour
tbrethou at cs.uiuc.edu
Sun May 23 14:36:01 PDT 2004
Changes in directory llvm/include/llvm/CodeGen:
MachineInstr.h updated: 1.146 -> 1.147
---
Log message:
Adding support to clone MachineInstr
---
Diffs of the changes: (+13 -1)
Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.146 llvm/include/llvm/CodeGen/MachineInstr.h:1.147
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.146 Fri Apr 16 10:57:14 2004
+++ llvm/include/llvm/CodeGen/MachineInstr.h Sun May 23 14:35:12 2004
@@ -172,6 +172,7 @@
contents.SymbolName = new std::string(M.getSymbolName());
}
+
~MachineOperand() {
if (isExternalSymbol())
delete contents.SymbolName;
@@ -367,7 +368,9 @@
// OperandComplete - Return true if it's illegal to add a new operand
bool OperandsComplete() const;
- MachineInstr(const MachineInstr &); // DO NOT IMPLEMENT
+ //Constructor used by clone() method
+ MachineInstr(const MachineInstr&);
+
void operator=(const MachineInstr&); // DO NOT IMPLEMENT
// Intrusive list support
@@ -395,6 +398,9 @@
const MachineBasicBlock* getParent() const { return parent; }
MachineBasicBlock* getParent() { return parent; }
+ //void setParent(const MachineBasicBlock *MBB) { parent = MBB; }
+ void setParent(MachineBasicBlock *MBB) { parent = MBB; }
+
/// getOpcode - Returns the opcode of this MachineInstr.
///
const int getOpcode() const { return Opcode; }
@@ -454,6 +460,12 @@
SetMachineOperandVal(i + getNumOperands(),
MachineOperand::MO_VirtualRegister, V);
}
+
+ //Clone Instruction
+ //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* clone();
//
// Debugging support
More information about the llvm-commits
mailing list