1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Changed clone to be const.

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

llvm-svn: 13706
This commit is contained in:
Tanya Lattner 2004-05-24 03:14:18 +00:00
parent 1790a73dc5
commit 55477a5af1
2 changed files with 8 additions and 2 deletions

View File

@ -460,7 +460,7 @@ public:
/// clone - Create a copy of 'this' instruction that is identical in
/// all ways except the the instruction has no parent, prev, or next.
MachineInstr* clone();
MachineInstr* clone() const;
//
// Debugging support

View File

@ -78,6 +78,12 @@ MachineInstr::MachineInstr(const MachineInstr &MI) {
//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 @@ MachineInstr::~MachineInstr()
///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);
}