From bbec604000804c99a9a612e1b8e17ec407017bdb Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 26 Apr 2014 22:51:31 +0000 Subject: [PATCH] [LCG] Eliminate more boiler plate by using the iterator facade base class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207336 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/iterator.h | 2 +- include/llvm/Analysis/LazyCallGraph.h | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/llvm/ADT/iterator.h b/include/llvm/ADT/iterator.h index 00d0ba15edd..0b33d7e0a1f 100644 --- a/include/llvm/ADT/iterator.h +++ b/include/llvm/ADT/iterator.h @@ -32,7 +32,7 @@ namespace llvm { /// terms of addition of one. These aren't equivalent for all iterator /// categories, and respecting that adds a lot of complexity for little gain. template struct iterator_facade_base : std::iterator { + : public iterator_facade_base { friend class LazyCallGraph; friend class LazyCallGraph::Node; @@ -251,22 +252,14 @@ public: bool operator==(const postorder_scc_iterator &Arg) const { return G == Arg.G && C == Arg.C; } - bool operator!=(const postorder_scc_iterator &Arg) const { - return !operator==(Arg); - } reference operator*() const { return *C; } - pointer operator->() const { return &operator*(); } + using iterator_facade_base::operator++; postorder_scc_iterator &operator++() { C = G->getNextSCCInPostOrder(); return *this; } - postorder_scc_iterator operator++(int) { - postorder_scc_iterator prev = *this; - ++*this; - return prev; - } }; /// \brief Construct a graph for the given module.