mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
make machine operands fatter: give each one an up-pointer to the
machineinstr that owns it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -85,8 +85,10 @@ MachineInstr::MachineInstr(const MachineInstr &MI) {
|
||||
Operands.reserve(MI.getNumOperands());
|
||||
|
||||
// Add operands
|
||||
for (unsigned i = 0; i != MI.getNumOperands(); ++i)
|
||||
for (unsigned i = 0; i != MI.getNumOperands(); ++i) {
|
||||
Operands.push_back(MI.getOperand(i));
|
||||
Operands.back().ParentMI = this;
|
||||
}
|
||||
|
||||
// Set parent, next, and prev to null
|
||||
parent = 0;
|
||||
@@ -97,6 +99,10 @@ MachineInstr::MachineInstr(const MachineInstr &MI) {
|
||||
|
||||
MachineInstr::~MachineInstr() {
|
||||
LeakDetector::removeGarbageObject(this);
|
||||
#ifndef NDEBUG
|
||||
for (unsigned i = 0, e = Operands.size(); i != e; ++i)
|
||||
assert(Operands[i].ParentMI == this && "ParentMI mismatch!");
|
||||
#endif
|
||||
}
|
||||
|
||||
/// getOpcode - Returns the opcode of this MachineInstr.
|
||||
|
||||
Reference in New Issue
Block a user