[llvm] r206646 - [LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot

Chandler Carruth chandlerc at gmail.com
Fri Apr 18 13:44:16 PDT 2014


Author: chandlerc
Date: Fri Apr 18 15:44:16 2014
New Revision: 206646

URL: http://llvm.org/viewvc/llvm-project?rev=206646&view=rev
Log:
[LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot
caught). Sad that we don't have warnings for these things, but bleh, no
idea how to fix that.

Modified:
    llvm/trunk/lib/Analysis/LazyCallGraph.cpp

Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=206646&r1=206645&r2=206646&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Fri Apr 18 15:44:16 2014
@@ -65,7 +65,7 @@ LazyCallGraph::Node::Node(LazyCallGraph
   findCallees(Worklist, Visited, Callees, CalleeSet);
 }
 
-LazyCallGraph::LazyCallGraph(Module &M) {
+LazyCallGraph::LazyCallGraph(Module &M) : NextDFSNumber(0) {
   for (Function &F : M)
     if (!F.isDeclaration() && !F.hasLocalLinkage())
       if (EntryNodeSet.insert(&F))
@@ -89,16 +89,19 @@ LazyCallGraph::LazyCallGraph(Module &M)
 }
 
 LazyCallGraph::LazyCallGraph(LazyCallGraph &&G)
-    : BPA(std::move(G.BPA)), EntryNodes(std::move(G.EntryNodes)),
+    : BPA(std::move(G.BPA)), NodeMap(std::move(G.NodeMap)),
+      EntryNodes(std::move(G.EntryNodes)),
       EntryNodeSet(std::move(G.EntryNodeSet)), SCCBPA(std::move(G.SCCBPA)),
       SCCMap(std::move(G.SCCMap)), LeafSCCs(std::move(G.LeafSCCs)),
       DFSStack(std::move(G.DFSStack)),
-      SCCEntryNodes(std::move(G.SCCEntryNodes)) {
+      SCCEntryNodes(std::move(G.SCCEntryNodes)),
+      NextDFSNumber(G.NextDFSNumber) {
   updateGraphPtrs();
 }
 
 LazyCallGraph &LazyCallGraph::operator=(LazyCallGraph &&G) {
   BPA = std::move(G.BPA);
+  NodeMap = std::move(G.NodeMap);
   EntryNodes = std::move(G.EntryNodes);
   EntryNodeSet = std::move(G.EntryNodeSet);
   SCCBPA = std::move(G.SCCBPA);
@@ -106,6 +109,7 @@ LazyCallGraph &LazyCallGraph::operator=(
   LeafSCCs = std::move(G.LeafSCCs);
   DFSStack = std::move(G.DFSStack);
   SCCEntryNodes = std::move(G.SCCEntryNodes);
+  NextDFSNumber = G.NextDFSNumber;
   updateGraphPtrs();
   return *this;
 }





More information about the llvm-commits mailing list