diff options
author | Brad King <brad.king@kitware.com> | 2020-07-29 12:10:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-29 12:10:57 (GMT) |
commit | 62d876e4e3f1bf1086b26162ce7c05e72b71cbe8 (patch) | |
tree | 1e68a34215794fdc6d81335d893e2e285ca2a04c | |
parent | 8a521f5e104d531412f38759dcb5e45db822a3ba (diff) | |
parent | bd0d03386b0f02aa34da5438d8f78575cf2642e7 (diff) | |
download | CMake-62d876e4e3f1bf1086b26162ce7c05e72b71cbe8.zip CMake-62d876e4e3f1bf1086b26162ce7c05e72b71cbe8.tar.gz CMake-62d876e4e3f1bf1086b26162ce7c05e72b71cbe8.tar.bz2 |
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
-rw-r--r-- | Source/cmComputeComponentGraph.cxx | 8 | ||||
-rw-r--r-- | Source/cmComputeComponentGraph.h | 3 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 1 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index 81cd878..6591fb1 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -8,6 +8,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()); diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index 202888c..b873131 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -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 diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 607b948..8ca2168 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -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 diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 06ad64d..e717f71 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -118,6 +118,7 @@ bool cmComputeTargetDepends::Compute() // Identify components. cmComputeComponentGraph ccg(this->InitialGraph); + ccg.Compute(); if (this->DebugMode) { this->DisplayComponents(ccg); } |