package flowanalysis
- Source
- package.scala
- Alphabetic
- By Inheritance
- flowanalysis
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait AcyclicRegionType extends RegionType
- type ControlTree = Graph[FlowGraphNode, DiEdge[FlowGraphNode]]
Region control tree representing nesting of control structures; obtained from structural analysis.
- sealed trait CyclicRegionType extends RegionType
- class DataFlowAnalysis[Data, Environment <: DataFlowEnvironment[Data, Environment]] extends AnyRef
Performs structural data flow analysis based on the results of a StructuralAnalysis.
Performs structural data flow analysis based on the results of a StructuralAnalysis. In more detail, this means that the control tree produced by the StructuralAnalysis is traversed recursively in a depth-first manner. Individual regions are processed by piping an Environment through their nodes and joining the environments where paths meet up. Thus, the individual flow functions defined at the statement PCs of a method are combined using region-type-specific patterns to effectively act as a flow function of the entire region, which is then processed itself due to the recursive nature of the algorithm.
- See also
StructuralAnalysis, Environment
- trait DataFlowEnvironment[Data, T <: DataFlowEnvironment[Data, T]] extends AnyRef
A mapping from PDUWeb to Data, used to identify the state of variables during a given fixed point of the org.opalj.si.flowanalysis.DataFlowAnalysis.
- type FlowGraph = Graph[FlowGraphNode, DiEdge[FlowGraphNode]]
CFG-like basis for data-flow analysis and super flow graph.
- sealed trait FlowGraphNode extends Ordered[FlowGraphNode]
A node in a flow graph and control tree produced by the StructuralAnalysis.
- case class Region(regionType: RegionType, nodeIds: Set[Int], entry: FlowGraphNode) extends FlowGraphNode with Product with Serializable
Represents a region of nodes in a FlowGraph, consisting of multiple sub-nodes.
Represents a region of nodes in a FlowGraph, consisting of multiple sub-nodes. Can identify general acyclic and cyclic structures or more specialised instances of such structures such as IfThenElse or WhileLoop.
- regionType
The type of the region.
- nodeIds
The union of all ids the leafs that are contained in this region.
- entry
The direct child of this region that contains the first leaf to be executed when entering the region.
- sealed trait RegionType extends Product
- case class Statement(pc: Int) extends FlowGraphNode with Product with Serializable
Represents a single statement in a methods FlowGraph and is one of the leaf nodes to be grouped by a Region.
- type SuperFlowGraph = Graph[FlowGraphNode, Edge[FlowGraphNode]]
Flow graph with including region control tree information from structural analysis.
Value Members
- case object Block extends AcyclicRegionType with Product with Serializable
- case object Case extends AcyclicRegionType with Product with Serializable
- object GlobalEntry extends FlowGraphNode
An additional global entry node to a methods FlowGraph to ensure only one entry node exists.
- object GlobalExit extends FlowGraphNode
An additional global exit node to a methods FlowGraph to ensure only one exit node exists.
- case object IfThen extends AcyclicRegionType with Product with Serializable
- case object IfThenElse extends AcyclicRegionType with Product with Serializable
- case object Improper extends CyclicRegionType with Product with Serializable
- case object NaturalLoop extends CyclicRegionType with Product with Serializable
- case object Proper extends AcyclicRegionType with Product with Serializable
- case object SelfLoop extends CyclicRegionType with Product with Serializable
- object StructuralAnalysis
An algorithm that identifies several different types of flow regions in a given flow graph and reduces them to a single node iteratively.
An algorithm that identifies several different types of flow regions in a given flow graph and reduces them to a single node iteratively. The algorithm terminates either when a single node is left in the flow graph or such a state could not be reached after maxIterations.
On termination, the analyze function returns:
- The reduced flow graph, a single node equal to the root node of the control tree.
- A super flow graph as a combination of the given source flow graph and the control tree. For each node contained in the control tree, the super flow graph contains the node itself and edges to its children as referenced the control tree. However, its children are still connected with edges as contained in the source flow graph.
This representation eases traversal for data flow analysis such as by DataFlowAnalysis.- The control tree, as a hierarchic representation of the control flow regions identified by the algorithm.
This algorithm is adapted from Muchnick, S.S. (1997). Advanced Compiler Design and Implementation and optimized for performance.
- See also
- case object WhileLoop extends CyclicRegionType with Product with Serializable