Merge topic 'cmcomputecomponentgraph-compute-method'

bd0d03386b cmComputeComponentGraph: Move work out of constructor into Compute() method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5079
This commit is contained in:
Brad King
2020-07-29 12:10:24 +00:00
committed by Kitware Robot
4 changed files with 11 additions and 2 deletions
+6 -2
View File
@@ -7,6 +7,12 @@
cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
: InputGraph(input)
{
}
cmComputeComponentGraph::~cmComputeComponentGraph() = default;
void cmComputeComponentGraph::Compute()
{
// Identify components.
this->Tarjan();
@@ -17,8 +23,6 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
this->TransferEdges();
}
cmComputeComponentGraph::~cmComputeComponentGraph() = default;
void cmComputeComponentGraph::Tarjan()
{
int n = static_cast<int>(this->InputGraph.size());
+3
View File
@@ -31,6 +31,9 @@ public:
cmComputeComponentGraph(Graph const& input);
~cmComputeComponentGraph();
/** Run the computation. */
void Compute();
/** Get the adjacency list of the component graph. */
Graph const& GetComponentGraph() const { return this->ComponentGraph; }
EdgeList const& GetComponentGraphEdges(int c) const
+1
View File
@@ -626,6 +626,7 @@ void cmComputeLinkDepends::OrderLinkEntires()
// constraints disallow it.
this->CCG =
cm::make_unique<cmComputeComponentGraph>(this->EntryConstraintGraph);
this->CCG->Compute();
// The component graph is guaranteed to be acyclic. Start a DFS
// from every entry to compute a topological order for the
+1
View File
@@ -118,6 +118,7 @@ bool cmComputeTargetDepends::Compute()
// Identify components.
cmComputeComponentGraph ccg(this->InitialGraph);
ccg.Compute();
if (this->DebugMode) {
this->DisplayComponents(ccg);
}