This package holds the analyses of control flow of Graphity, on the control-flow graph of a method: the loop nesting forest with irreducible loops (Havlak), dominance frontiers and control dependence, and the iterated dominance frontiers where SSA (static single assignment) form places phi-nodes (Sreedhar and Gao).
It is a package of Graphity for TypeScript, which is the TypeScript implementation of the Java library Graphity. Its counterpart in Java is the module graphity-controlflow. The README of the repository shows how to use it and how its API relates to Java's.
npm install @kobayami/graphity-controlflow
Licensed under the Apache License 2.0; see the files LICENSE and NOTICE in the package.
Analyses of control flow: loops, dominance frontiers, control dependence and the placement of phi-nodes.
This package is the counterpart of the Java module
graphity-controlflow, released with@kobayami/graphity-coreat the same version. Its analyses work on a control-flow graph, with the basic blocks of a method as nodes and an edge wherever control can pass from one block to another:The analyses follow edges against their direction, so they take a
BiAdjacentGraph, or theDominatorscomputed on one; build it once and pass it to all of them. Here, the loop of a methodloadaround its blockthen, from its control flowcfgand its entry blockentry:The package uses only the public API of the core. Errors follow the core: a
RangeErrorwhere Java throws anIndexOutOfBoundsException, a plainErrorwhere it throws anIllegalArgumentException.