mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
Changed clone to be const.
Changed copy constructor to set parent, prev, and next pointers to null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
86f238230b
commit
0c63e03e04
@ -460,7 +460,7 @@ public:
|
|||||||
|
|
||||||
/// clone - Create a copy of 'this' instruction that is identical in
|
/// clone - Create a copy of 'this' instruction that is identical in
|
||||||
/// all ways except the the instruction has no parent, prev, or next.
|
/// all ways except the the instruction has no parent, prev, or next.
|
||||||
MachineInstr* clone();
|
MachineInstr* clone() const;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Debugging support
|
// Debugging support
|
||||||
|
@ -78,6 +78,12 @@ MachineInstr::MachineInstr(const MachineInstr &MI) {
|
|||||||
//Add operands
|
//Add operands
|
||||||
for(unsigned i=0; i < MI.getNumOperands(); ++i)
|
for(unsigned i=0; i < MI.getNumOperands(); ++i)
|
||||||
operands.push_back(MachineOperand(MI.getOperand(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
|
///clone - Create a copy of 'this' instruction that is identical in
|
||||||
///all ways except the following: The instruction has no parent The
|
///all ways except the following: The instruction has no parent The
|
||||||
///instruction has no name
|
///instruction has no name
|
||||||
MachineInstr* MachineInstr::clone() {
|
MachineInstr* MachineInstr::clone() const {
|
||||||
return new MachineInstr(*this);
|
return new MachineInstr(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user