[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h MachineBasicBlock.h
Alkis Evlogimenos
alkis at cs.uiuc.edu
Mon Feb 16 01:18:02 PST 2004
Changes in directory llvm/include/llvm/CodeGen:
MachineInstr.h updated: 1.136 -> 1.137
MachineBasicBlock.h updated: 1.18 -> 1.19
---
Log message:
Add LeakDetection to MachineInstr.
Move out of line member functions of MachineBasicBlock to
MachineBasicBlock.cpp.
---
Diffs of the changes: (+9 -22)
Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.136 llvm/include/llvm/CodeGen/MachineInstr.h:1.137
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.136 Fri Feb 13 15:01:20 2004
+++ llvm/include/llvm/CodeGen/MachineInstr.h Mon Feb 16 01:17:43 2004
@@ -345,7 +345,6 @@
// Intrusive list support
//
friend class ilist_traits<MachineInstr>;
- MachineInstr() : Opcode(0), numImplicitRefs(0) { /* used only by ilist */ }
public:
MachineInstr(short Opcode, unsigned numOperands);
@@ -363,6 +362,8 @@
///
MachineInstr(MachineBasicBlock *MBB, short Opcode, unsigned numOps);
+ ~MachineInstr();
+
const MachineBasicBlock* getParent() const { return parent; }
MachineBasicBlock* getParent() { return parent; }
Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.18 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.19
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.18 Fri Feb 13 14:05:56 2004
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Mon Feb 16 01:17:43 2004
@@ -24,8 +24,6 @@
template <>
class ilist_traits<MachineInstr>
{
- typedef ilist_traits<MachineInstr> self;
-
// this is only set by the MachineBasicBlock owning the ilist
friend class MachineBasicBlock;
MachineBasicBlock* parent;
@@ -45,25 +43,13 @@
static void setPrev(MachineInstr* N, MachineInstr* prev) { N->prev = prev; }
static void setNext(MachineInstr* N, MachineInstr* next) { N->next = next; }
- static MachineInstr* createNode() { return new MachineInstr(0, 0); }
-
- void addNodeToList(MachineInstr* N) {
- assert(N->parent == 0 && "machine instruction already in a basic block");
- N->parent = parent;
- }
-
- void removeNodeFromList(MachineInstr* N) {
- assert(N->parent != 0 && "machine instruction not in a basic block");
- N->parent = 0;
- }
-
- void transferNodesFromList(iplist<MachineInstr, self>& toList,
- ilist_iterator<MachineInstr> first,
- ilist_iterator<MachineInstr> last) {
- if (parent != toList.parent)
- for (; first != last; ++first)
- first->parent = toList.parent;
- }
+ static MachineInstr* createNode();
+ void addNodeToList(MachineInstr* N);
+ void removeNodeFromList(MachineInstr* N);
+ void transferNodesFromList(
+ iplist<MachineInstr, ilist_traits<MachineInstr> >& toList,
+ ilist_iterator<MachineInstr> first,
+ ilist_iterator<MachineInstr> last);
};
class BasicBlock;
More information about the llvm-commits
mailing list