summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-23 23:34:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-23 23:34:48 +0000
commit306d5ba0923b6554c5c6e1c43cae9ae08341459d (patch)
treeda99ce115fee7d7103a738bc20ff3d01a62c5812 /include
parent807c1bc84737bd27d739dddf07b8597098bfc6b2 (diff)
downloadllvm-306d5ba0923b6554c5c6e1c43cae9ae08341459d.tar.gz
llvm-306d5ba0923b6554c5c6e1c43cae9ae08341459d.tar.bz2
llvm-306d5ba0923b6554c5c6e1c43cae9ae08341459d.tar.xz
[LCG] Switch the primary node iterator to be a *much* more normal C++
iterator, returning a Node by reference on dereference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/LazyCallGraph.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h
index 1b0e1dbf27..6aa0b8e0a2 100644
--- a/include/llvm/Analysis/LazyCallGraph.h
+++ b/include/llvm/Analysis/LazyCallGraph.h
@@ -112,8 +112,7 @@ public:
/// be scanned for "calls" or uses of functions and its child information
/// will be constructed. All of these results are accumulated and cached in
/// the graph.
- class iterator : public std::iterator<std::bidirectional_iterator_tag, Node *,
- ptrdiff_t, Node *, Node *> {
+ class iterator : public std::iterator<std::bidirectional_iterator_tag, Node> {
friend class LazyCallGraph;
friend class LazyCallGraph::Node;
typedef std::iterator<std::bidirectional_iterator_tag, Node *, ptrdiff_t,
@@ -139,14 +138,14 @@ public:
reference operator*() const {
if (NI->is<Node *>())
- return NI->get<Node *>();
+ return *NI->get<Node *>();
Function *F = NI->get<Function *>();
Node &ChildN = G->get(*F);
*NI = &ChildN;
- return &ChildN;
+ return ChildN;
}
- pointer operator->() const { return operator*(); }
+ pointer operator->() const { return &operator*(); }
iterator &operator++() {
++NI;