diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index 8dc39fb73cb..2d707153e12 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -369,7 +369,8 @@ struct ilist_traits { 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); } diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index a7d031bad4b..4cf4b35c660 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -45,7 +45,8 @@ public: 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( diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 01610c20aa0..ffd941d1112 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -55,7 +55,8 @@ public: 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::createNode() { +Instruction *ilist_traits::createSentinal() { return new DummyInst(); } iplist &ilist_traits::getList(BasicBlock *BB) { diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index c63b1acdc42..770715f67da 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -20,7 +20,7 @@ #include "llvm/ADT/StringExtras.h" using namespace llvm; -BasicBlock *ilist_traits::createNode() { +BasicBlock *ilist_traits::createSentinal() { BasicBlock *Ret = new BasicBlock(); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); @@ -31,7 +31,7 @@ iplist &ilist_traits::getList(Function *F) { return F->getBasicBlockList(); } -Argument *ilist_traits::createNode() { +Argument *ilist_traits::createSentinal() { Argument *Ret = new Argument(Type::IntTy); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 3759cfd85eb..a935bf64b0e 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -28,7 +28,7 @@ using namespace llvm; // Methods to implement the globals and functions lists. // -Function *ilist_traits::createNode() { +Function *ilist_traits::createSentinal() { FunctionType *FTy = FunctionType::get(Type::VoidTy, std::vector(), false); Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage); @@ -36,7 +36,7 @@ Function *ilist_traits::createNode() { LeakDetector::removeGarbageObject(Ret); return Ret; } -GlobalVariable *ilist_traits::createNode() { +GlobalVariable *ilist_traits::createSentinal() { GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false, GlobalValue::ExternalLinkage); // This should not be garbage monitored.