diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-24 08:55:36 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-24 08:55:36 +0000 |
| commit | d52f8e0e4dd0106ea7da078039f7945e52baaa7e (patch) | |
| tree | 0f4afe2cb98215d68434b052e98f9461052c23cd /llvm/lib | |
| parent | 27c486ffe11bc0d535f7ae256c4c00e7b9b6c7ae (diff) | |
| download | bcm5719-llvm-d52f8e0e4dd0106ea7da078039f7945e52baaa7e.tar.gz bcm5719-llvm-d52f8e0e4dd0106ea7da078039f7945e52baaa7e.zip | |
[LCG] We don't actually need a set in each SCC to track the nodes. We
can use the node -> SCC mapping in the top-level graph to test this on
the rare occasions we need it.
llvm-svn: 207090
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/LazyCallGraph.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index db6aed3b7a5..832d2b9e7e6 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -282,7 +282,6 @@ LazyCallGraph::SCC::removeInternalEdge(LazyCallGraph &G, Node &Caller, // Replace this SCC with the NewNodes we collected above. // FIXME: Simplify this when the SCC's datastructure is just a list. Nodes.clear(); - NodeSet.clear(); // Now we need to reconnect the current SCC to the graph. bool IsLeafSCC = true; @@ -290,7 +289,6 @@ LazyCallGraph::SCC::removeInternalEdge(LazyCallGraph &G, Node &Caller, N->DFSNumber = -1; N->LowLink = -1; Nodes.push_back(N); - NodeSet.insert(&N->getFunction()); for (Node &ChildN : *N) { if (NewNodes.count(&ChildN)) continue; @@ -393,10 +391,6 @@ LazyCallGraph::SCC *LazyCallGraph::formSCCFromDFSStack( SCCMap[SCCN] = NewSCC; NewSCC->Nodes.push_back(SCCN); - bool Inserted = - NewSCC->NodeSet.insert(&SCCN->getFunction()); - (void)Inserted; - assert(Inserted && "Cannot have duplicates in the DFSStack!"); } DFSStack.erase(SCCBegin, DFSStack.end()); @@ -406,7 +400,7 @@ LazyCallGraph::SCC *LazyCallGraph::formSCCFromDFSStack( bool IsLeafSCC = true; for (Node *SCCN : NewSCC->Nodes) for (Node &SCCChildN : *SCCN) { - if (NewSCC->NodeSet.count(&SCCChildN.getFunction())) + if (SCCMap.lookup(&SCCChildN) == NewSCC) continue; SCC &ChildSCC = *SCCMap.lookup(&SCCChildN); ChildSCC.ParentSCCs.insert(NewSCC); |

