[LCG] Make this call graph a fully regular type by giving it assignment
authorChandler Carruth <chandlerc@gmail.com>
Mon, 10 Mar 2014 08:08:59 +0000 (08:08 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 10 Mar 2014 08:08:59 +0000 (08:08 +0000)
as well. I don't see any particular need but it imposes no cost to
support it and it makes the API cleaner.

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

include/llvm/Analysis/LazyCallGraph.h

index 6b93bb26a89dfe453d9b344dbe4f42c26e902063..74b0c8e9184ceebb17165d58a910f3c4e29ec060 100644 (file)
@@ -192,6 +192,12 @@ public:
   /// 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;
+  }
+
   iterator begin() { return iterator(*this, EntryNodes); }
   iterator end() { return iterator(*this, EntryNodes, iterator::IsAtEndT()); }