Source code for angr.analyses.forward_analysis.visitors.loop
from angr.utils.graph import GraphUtils
from .graph import GraphVisitor
[docs]class LoopVisitor(GraphVisitor):
"""
:param angr.analyses.loopfinder.Loop loop: The loop to visit.
"""
[docs] def sort_nodes(self, nodes=None):
sorted_nodes = GraphUtils.quasi_topological_sort_nodes(self.loop.graph)
if nodes is not None:
sorted_nodes = [n for n in sorted_nodes if n in set(nodes)]
return sorted_nodes