static void setPrev(DSNode *N, DSNode *Prev) { N->Prev = Prev; }
static void setNext(DSNode *N, DSNode *Next) { N->Next = Next; }
- static DSNode *createNode() { return new DSNode(0,0); }
+ static DSNode *createSentinal() { return new DSNode(0,0); }
+ static void destroySentinal(DSNode *N) { delete N; }
//static DSNode *createNode(const DSNode &V) { return new DSNode(V); }
static void setPrev(MachineInstr* N, MachineInstr* prev) { N->prev = prev; }
static void setNext(MachineInstr* N, MachineInstr* next) { N->next = next; }
- static MachineInstr* createNode();
+ static MachineInstr* createSentinal();
+ static void destroySentinal(MachineInstr *MI) { delete MI; }
void addNodeToList(MachineInstr* N);
void removeNodeFromList(MachineInstr* N);
void transferNodesFromList(
N->Next = next;
}
- static MachineBasicBlock* createNode();
+ static MachineBasicBlock* createSentinal();
+ static void destroySentinal(MachineBasicBlock *MBB) { delete MBB; }
void addNodeToList(MachineBasicBlock* N);
void removeNodeFromList(MachineBasicBlock* N);
void transferNodesFromList(iplist<MachineBasicBlock,
};
}
-Instruction *ilist_traits<Instruction>::createNode() {
+Instruction *ilist_traits<Instruction>::createSentinal() {
return new DummyInst();
}
iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
#include "llvm/ADT/StringExtras.h"
using namespace llvm;
-BasicBlock *ilist_traits<BasicBlock>::createNode() {
+BasicBlock *ilist_traits<BasicBlock>::createSentinal() {
BasicBlock *Ret = new BasicBlock();
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(Ret);
return F->getBasicBlockList();
}
-Argument *ilist_traits<Argument>::createNode() {
+Argument *ilist_traits<Argument>::createSentinal() {
Argument *Ret = new Argument(Type::IntTy);
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(Ret);
// Methods to implement the globals and functions lists.
//
-Function *ilist_traits<Function>::createNode() {
+Function *ilist_traits<Function>::createSentinal() {
FunctionType *FTy =
FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage);
LeakDetector::removeGarbageObject(Ret);
return Ret;
}
-GlobalVariable *ilist_traits<GlobalVariable>::createNode() {
+GlobalVariable *ilist_traits<GlobalVariable>::createSentinal() {
GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false,
GlobalValue::ExternalLinkage);
// This should not be garbage monitored.