diff options
author | Brad King <brad.king@kitware.com> | 2018-10-17 14:46:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-18 12:11:19 (GMT) |
commit | dacbb414550db63ff40225f3f6057c3c74bcf5c9 (patch) | |
tree | 6f51a0e964005de1c3a715e8734181838777aa2a /Source/cmComputeLinkDepends.cxx | |
parent | a6e02f881dc5e74d79201f761fb28c99a9e7d2af (diff) | |
download | CMake-dacbb414550db63ff40225f3f6057c3c74bcf5c9.zip CMake-dacbb414550db63ff40225f3f6057c3c74bcf5c9.tar.gz CMake-dacbb414550db63ff40225f3f6057c3c74bcf5c9.tar.bz2 |
Track backtraces in target dependencies internally
Carry backtraces on target dependency edges to refer to the line in
project code that caused the edge to appear.
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index e3d53e4..4717cf6 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -420,7 +420,8 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep) // This shared library dependency must follow the item that listed // it. - this->EntryConstraintGraph[dep.DependerIndex].push_back(index); + this->EntryConstraintGraph[dep.DependerIndex].emplace_back( + index, true, cmListFileBacktrace()); // Target items may have their own dependencies. if (entry.Target) { @@ -523,7 +524,8 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index, // The dependee must come after the depender. if (depender_index >= 0) { - this->EntryConstraintGraph[depender_index].push_back(dependee_index); + this->EntryConstraintGraph[depender_index].emplace_back( + dependee_index, false, cmListFileBacktrace()); } else { // This is a direct dependency of the target being linked. this->OriginalEntries.push_back(dependee_index); @@ -595,7 +597,10 @@ void cmComputeLinkDepends::InferDependencies() // Add the inferred dependencies to the graph. cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index]; - edges.insert(edges.end(), common.begin(), common.end()); + edges.reserve(edges.size() + common.size()); + for (auto const& c : common) { + edges.emplace_back(c, true, cmListFileBacktrace()); + } } } |