/** * Reaching Definitions Data Flow Analysis * * This module implements the Reaching Definitions data flow analysis algorithm. * Reaching Definitions is a forward data flow analysis that determines, for each * program point, the set of variable definitions (assignments) that may reach * that point without being overwritten. * * Key Components: * 1. **Transfer Function**: * - Computes the out set for each node based on its in set. * - Uses gen and kill sets to model the effects of assignments: * - **gen**: The set of definitions generated by the current node. * - **kill**: The set of definitions killed (overwritten) by the current node. * * 2. **Meet Operation**: * - Combines data flow values from multiple paths (e.g., union for reaching definitions). * - Ensures that the analysis is conservative (safe) by over-approximating the result. * * The analysis is forward, meaning it propagates information from predecessors to successors. * */ import { Stmt } from '../base/Stmt'; import { BaseImplicitGraph, NodeID } from '../graph/BaseImplicitGraph'; import { ArkMethod } from '../model/ArkMethod'; import { DataFlowProblem, TransferFunction, FlowGraph } from './GenericDataFlow'; import { SparseBitVector } from '../../utils/SparseBitVector'; type RDNode = Stmt; type DFNodeCollection = SparseBitVector; export declare class ReachingDefProblem implements DataFlowProblem { flowGraph: ReachingDefFlowGraph; transferFunction: ReachingDefTransferFunction; meet: (a: DFNodeCollection, b: DFNodeCollection) => DFNodeCollection; initIn: Map; initOut: Map; forward: boolean; empty: DFNodeCollection; constructor(method: ArkMethod, forward?: boolean); } /** * Represents the control flow graph (CFG) for reaching definitions analysis. * This class implements the FlowGraph interface and provides methods to retrieve * successors and predecessors of nodes, as well as topological orderings of nodes. */ declare class ReachingDefFlowGraph extends BaseImplicitGraph implements FlowGraph { nodesInPostOrder: NodeID[]; constructor(method: ArkMethod); getGraphName(): string; dumpNodes(): void; private initSuccPred; } /** * Represents the transfer function for reaching definitions analysis. */ export declare class ReachingDefTransferFunction implements TransferFunction { gen: DFNodeCollection; kill: Map; constructor(flowGraph: ReachingDefFlowGraph); apply(n: NodeID, x: DFNodeCollection): DFNodeCollection; private initGenKill; } export {}; //# sourceMappingURL=ReachingDef.d.ts.map