OSDN Git Service

ADT: Remove ilist_iterator::reset(), NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 11 Sep 2016 20:47:27 +0000 (20:47 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 11 Sep 2016 20:47:27 +0000 (20:47 +0000)
ilist_iterator::reset was unnecessary API, and wasn't any clearer (or
safer) at the call site than constructing a temporary and assigning it
to the iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281175 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ilist_iterator.h
include/llvm/IR/IRBuilder.h

index 9e85518..ef532d2 100644 (file)
@@ -121,8 +121,6 @@ public:
     return ilist_iterator<OptionsT, IsReverse, false>();
   }
 
-  void reset(pointer NP) { NodePtr = NP; }
-
   // Accessors...
   reference operator*() const {
     assert(!NodePtr->isKnownSentinel());
index 93e1af6..a4c4096 100644 (file)
@@ -114,7 +114,7 @@ public:
   /// inserted into a block.
   void ClearInsertionPoint() {
     BB = nullptr;
-    InsertPt.reset(nullptr);
+    InsertPt = BasicBlock::iterator();
   }
 
   BasicBlock *GetInsertBlock() const { return BB; }