[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.

llvm-svn: 203448

llvm/include/llvm/Analysis/LazyCallGraph.h

index 6b93bb2..74b0c8e 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()); }