diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-18 11:02:33 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-18 11:02:33 +0000 |
commit | 14def5573601bd07e8e9eea36fa41b77e1eac96e (patch) | |
tree | a201ca504bf4fb48481212b14837d03d8f2fe2f7 /include | |
parent | d61b3c303c7c3241b10e414f248eb8be3d374664 (diff) | |
download | llvm-14def5573601bd07e8e9eea36fa41b77e1eac96e.tar.gz llvm-14def5573601bd07e8e9eea36fa41b77e1eac96e.tar.bz2 llvm-14def5573601bd07e8e9eea36fa41b77e1eac96e.tar.xz |
[LCG] Remove all of the complexity stemming from supporting copying.
Reality is that we're never going to copy one of these. Supporting this
was becoming a nightmare because nothing even causes it to compile most
of the time. Lots of subtle errors built up that wouldn't have been
caught by any "normal" testing.
Also, make the move assignment actually work rather than the bogus swap
implementation that would just infloop if used. As part of that, factor
out the graph pointer updates into a helper to share between move
construction and move assignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/LazyCallGraph.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h index bcd06c2a10..66d3d50585 100644 --- a/include/llvm/Analysis/LazyCallGraph.h +++ b/include/llvm/Analysis/LazyCallGraph.h @@ -193,9 +193,6 @@ public: /// CalleeSet. Node(LazyCallGraph &G, Function &F); - /// \brief Constructor used when copying a node from one graph to another. - Node(LazyCallGraph &G, const Node &OtherN); - public: typedef LazyCallGraph::iterator iterator; @@ -291,23 +288,8 @@ public: /// requested during traversal. LazyCallGraph(Module &M); - /// \brief Copy constructor. - /// - /// This does a deep copy of the graph. It does no verification that the - /// graph remains valid for the module. It is also relatively expensive. - LazyCallGraph(const LazyCallGraph &G); - - /// \brief Move constructor. - /// - /// This is a deep move. It leaves G in an undefined but destroyable state. - /// Any other operation on G is likely to fail. LazyCallGraph(LazyCallGraph &&G); - - /// \brief Copy and move assignment. - LazyCallGraph &operator=(LazyCallGraph RHS) { - std::swap(*this, RHS); - return *this; - } + LazyCallGraph &operator=(LazyCallGraph &&RHS); iterator begin() { return iterator(*this, EntryNodes); } iterator end() { return iterator(*this, EntryNodes, iterator::IsAtEndT()); } @@ -378,8 +360,8 @@ private: /// the NodeMap. Node *insertInto(Function &F, Node *&MappedN); - /// \brief Helper to copy a node from another graph into this one. - Node *copyInto(const Node &OtherN); + /// \brief Helper to update pointers back to the graph object during moves. + void updateGraphPtrs(); /// \brief Retrieve the next node in the post-order SCC walk of the call graph. SCC *getNextSCCInPostOrder(); |