[llvm] r200905 - [PM] Fix horrible typos that somehow didn't cause a failure in a C++11
Chandler Carruth
chandlerc at gmail.com
Wed Feb 5 21:17:02 PST 2014
Author: chandlerc
Date: Wed Feb 5 23:17:02 2014
New Revision: 200905
URL: http://llvm.org/viewvc/llvm-project?rev=200905&view=rev
Log:
[PM] Fix horrible typos that somehow didn't cause a failure in a C++11
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.
Modified:
llvm/trunk/include/llvm/Analysis/LazyCallGraph.h
llvm/trunk/lib/Analysis/LazyCallGraph.cpp
Modified: llvm/trunk/include/llvm/Analysis/LazyCallGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyCallGraph.h?rev=200905&r1=200904&r2=200905&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LazyCallGraph.h (original)
+++ llvm/trunk/include/llvm/Analysis/LazyCallGraph.h Wed Feb 5 23:17:02 2014
@@ -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;
Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=200905&r1=200904&r2=200905&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Wed Feb 5 23:17:02 2014
@@ -115,9 +115,9 @@ LazyCallGraph::LazyCallGraph(Module &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 LazyC
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
More information about the llvm-commits
mailing list