summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/ilist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/ilist.h')
-rw-r--r--include/llvm/ADT/ilist.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h
index 9700b60f24..e66ee2f40b 100644
--- a/include/llvm/ADT/ilist.h
+++ b/include/llvm/ADT/ilist.h
@@ -60,6 +60,7 @@ struct ilist_traits {
static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); }
static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); }
+ static void deleteNode(NodeTy *V) { delete V; }
static NodeTy *createSentinel() { return new NodeTy(); }
static void destroySentinel(NodeTy *N) { delete N; }
@@ -121,8 +122,7 @@ public:
assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
return *NodePtr;
}
- pointer operator->() { return &operator*(); }
- const pointer operator->() const { return &operator*(); }
+ pointer operator->() const { return &operator*(); }
// Comparison operators
bool operator==(const ilist_iterator &RHS) const {
@@ -380,7 +380,7 @@ public:
// erase - remove a node from the controlled sequence... and delete it.
iterator erase(iterator where) {
- delete remove(where);
+ deleteNode(remove(where));
return where;
}