fixes the subroutine ordering in the run plugin #1011
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
run-entry-points
is set toall-subroutines
, we launch all the subroutines in the topological order. The problem is that if a real callgraph doesn't have a common entry from which all subroutinesare reachable, but instead is represented as a few spanning trees, then the reverse postorder traverse of a graph will produce an ordering that is far from the topological. We address this issue by connecting roots of all trees to an artificial entry point before sorting.
Skip visited
A bonus feature is a new command line option to the run plugin that when set (on by default) will not revisit a subroutine if it was already visited. This is only applicable when a set of entry points
(or all entry points) were specified to the run plugin, and it investigates each in separate.
The justification for this behavior is that if we already had visited a subroutine, then we entered it through some other subroutine, i.e., we investigated it under a richer context, so there is no need to call it directly. Of course, this is a heuristic, so it can be disabled: