diff options
author | David Malcolm <dmalcolm@redhat.com> | 2021-03-11 17:45:10 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2021-03-11 17:45:10 -0500 |
commit | 5e33e5b042a6a830c40cee3d0a925bc49dcfe069 (patch) | |
tree | 65f3ab1dcfe34675960c710ed78b202e07783992 /gcc/analyzer | |
parent | 3f958348e78f38d91f0611618bb909182170c0f3 (diff) | |
download | gcc-5e33e5b042a6a830c40cee3d0a925bc49dcfe069.zip gcc-5e33e5b042a6a830c40cee3d0a925bc49dcfe069.tar.gz gcc-5e33e5b042a6a830c40cee3d0a925bc49dcfe069.tar.bz2 |
analyzer: support reverse direction in shortest-paths.h
This patch generalizes shortest-path.h so that it can be used to
find the shortest path from each node to a given target node (on top
of the existing support for finding the shortest path from a given
origin node to each node).
I've marked this as "analyzer" as this is the only code using
shortest-paths.h.
This patch is required by followup work to fix PR analyzer/96374.
gcc/analyzer/ChangeLog:
* diagnostic-manager.cc (epath_finder::epath_finder):
Update shortest_paths init for new param.
gcc/ChangeLog:
* digraph.cc (selftest::test_shortest_paths): Update
shortest_paths init for new param. Add test of
SPS_TO_GIVEN_TARGET.
* shortest-paths.h (enum shortest_path_sense): New.
(shortest_paths::shortest_paths): Add "sense" param.
Update for renamings. Generalize to use "sense" param.
(shortest_paths::get_shortest_path): Rename param.
(shortest_paths::m_sense): New field.
(shortest_paths::m_prev): Rename...
(shortest_paths::m_best_edge): ...to this.
(shortest_paths::get_shortest_path): Update for renamings.
Conditionalize flipping of path on sense of traversal.
Diffstat (limited to 'gcc/analyzer')
-rw-r--r-- | gcc/analyzer/diagnostic-manager.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index 7f20841..e84953e 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -73,7 +73,7 @@ class epath_finder public: epath_finder (const exploded_graph &eg) : m_eg (eg), - m_sep (eg, eg.get_origin ()) + m_sep (eg, eg.get_origin (), SPS_FROM_GIVEN_ORIGIN) { } |