[PM] Fix horrible typos that somehow didn't cause a failure in a C++11
authorChandler Carruth <chandlerc@gmail.com>
Thu, 6 Feb 2014 05:17:02 +0000 (05:17 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 6 Feb 2014 05:17:02 +0000 (05:17 +0000)
build but spectacularly changed behavior of the C++98 build. =]

This shows my one problem with not having unittests -- basic API
expectations aren't well exercised by the integration tests because they
*happen* to not come up, even though they might later. I'll probably add
a basic unittest to complement the integration testing later, but
I wanted to revive the bots.

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

include/llvm/Analysis/LazyCallGraph.h
lib/Analysis/LazyCallGraph.cpp

index d355b9cf5a62b783557f449dbfad9dae47a4de3e..82dea95e2a053dbfa02b06fe488bf9f13ea2c93a 100644 (file)
@@ -248,7 +248,7 @@ private:
 /// callees, de-duplicate and provide fast testing of whether a function is
 /// a callee, and facilitate iteration of child nodes in the graph.
 class LazyCallGraph::Node {
-  friend LazyCallGraph;
+  friend class LazyCallGraph;
 
   LazyCallGraph &G;
   Function &F;
index b89bf70b43305a73778a048fecad70c9ca72fc38..7ae63e27c61d535efd45047fab354bccd36d1a0e 100644 (file)
@@ -115,9 +115,9 @@ LazyCallGraph::LazyCallGraph(Module &M) : M(M) {
 
 LazyCallGraph::LazyCallGraph(const LazyCallGraph &G)
     : M(G.M), EntryNodeSet(G.EntryNodeSet) {
-  EntryNodes.reserve(EntryNodes.size());
-  for (NodeVectorImplT::iterator EI = EntryNodes.begin(),
-                                 EE = EntryNodes.end();
+  EntryNodes.reserve(G.EntryNodes.size());
+  for (NodeVectorImplT::const_iterator EI = G.EntryNodes.begin(),
+                                       EE = G.EntryNodes.end();
        EI != EE; ++EI)
     if (Function *Callee = EI->dyn_cast<Function *>())
       EntryNodes.push_back(Callee);
@@ -132,12 +132,14 @@ LazyCallGraph::LazyCallGraph(const LazyCallGraph &G)
 LazyCallGraph::LazyCallGraph(LazyCallGraph &&G)
     : M(G.M), EntryNodes(std::move(G.EntryNodes)),
       EntryNodeSet(std::move(G.EntryNodeSet)) {
-  // Loop over our EntryNodes. They've been moved from another graph, but we
-  // need to move the Node*s to live under our bump ptr allocator.
-  for (NodeVectorImplT::iterator EI = EntryNodes.begin(), EE = EntryNodes.end();
+  // Loop over our EntryNodes. They've been moved from another graph, so we
+  // need to move the Node*s to live under our bump ptr allocator. We can just
+  // do this in-place.
+  for (NodeVectorImplT::iterator EI = EntryNodes.begin(),
+                                 EE = EntryNodes.end();
        EI != EE; ++EI)
     if (Node *EntryN = EI->dyn_cast<Node *>())
-      *EI = G.moveInto(std::move(*EntryN));
+      *EI = moveInto(std::move(*EntryN));
 }
 #endif