diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-16 11:14:28 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-16 11:14:28 +0000 |
| commit | eacd996daf0399e9e5773e561fb1adcbe88456a4 (patch) | |
| tree | 1bf828a765e0a75e378c093a97fbeb03f6c9f0ad /llvm/include | |
| parent | 49b568ead825dddd7919a1f466f3f7760df4ade5 (diff) | |
| download | bcm5719-llvm-eacd996daf0399e9e5773e561fb1adcbe88456a4.tar.gz bcm5719-llvm-eacd996daf0399e9e5773e561fb1adcbe88456a4.zip | |
[LCG] Stop playing fast and loose with reference members and assignment.
It doesn't work. I'm still cleaning up all the places where I blindly
followed this pattern. There are more to come in this code too.
As a benefit, this lets the default copy and move operations Just Work.
llvm-svn: 206375
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/LazyCallGraph.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index 74b0c8e9184..d5785e740ae 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -119,25 +119,18 @@ public: /// \brief Nonce type to select the constructor for the end iterator. struct IsAtEndT {}; - LazyCallGraph &G; + LazyCallGraph *G; NodeVectorImplT::iterator NI; // Build the begin iterator for a node. explicit iterator(LazyCallGraph &G, NodeVectorImplT &Nodes) - : G(G), NI(Nodes.begin()) {} + : G(&G), NI(Nodes.begin()) {} // Build the end iterator for a node. This is selected purely by overload. iterator(LazyCallGraph &G, NodeVectorImplT &Nodes, IsAtEndT /*Nonce*/) - : G(G), NI(Nodes.end()) {} + : G(&G), NI(Nodes.end()) {} public: - iterator(const iterator &Arg) : G(Arg.G), NI(Arg.NI) {} - iterator(iterator &&Arg) : G(Arg.G), NI(std::move(Arg.NI)) {} - iterator &operator=(iterator Arg) { - std::swap(Arg, *this); - return *this; - } - bool operator==(const iterator &Arg) { return NI == Arg.NI; } bool operator!=(const iterator &Arg) { return !operator==(Arg); } @@ -146,7 +139,7 @@ public: return NI->get<Node *>(); Function *F = NI->get<Function *>(); - Node *ChildN = G.get(*F); + Node *ChildN = G->get(*F); *NI = ChildN; return ChildN; } |

