UNPKG

@specs-feup/clava

Version:

A C/C++ source-to-source compiler written in Typescript

51 lines 2.12 kB
import cytoscape from "cytoscape"; import ControlFlowGraph from "../graphs/ControlFlowGraph.js"; export default class LivenessAnalysis { /** * Maps each CFG node ID to the corresponding def set */ private defsMap; /** * Maps each CFG node ID to the corresponding use set */ private usesMap; /** * Maps each CFG node ID to the corresponding LiveIn set */ private liveInMap; /** * Maps each CFG node ID to the corresponding LiveOut set */ private liveOutMap; /** * Creates a new instance of the LivenessAnalysis class * @param defs - A map with CFG node IDs as keys and their corresponding def set as value * @param uses - A map with CFG node IDs as keys and their corresponding use set as value * @param liveIn - A map with CFG node IDs as keys and their corresponding live in set as value * @param liveOut - A map with CFG node IDs as keys and their corresponding live out set as value */ constructor(defs: Map<string, Set<string>>, uses: Map<string, Set<string>>, liveIn: Map<string, Set<string>>, liveOut: Map<string, Set<string>>); /** * * @param cfg - The control flow graph. Can be either a Cytoscape graph or a ControlFlowGraph object and each instruction list node must contain only one statement * @returns A new instance of the LivenessAnalysis class */ static analyse(cfg: ControlFlowGraph | cytoscape.Core): LivenessAnalysis; /** * @returns A map with CFG node IDs as keys and their corresponding def set as value */ get defs(): Map<string, Set<string>>; /** * @returns A map with CFG node IDs as keys and their corresponding use set as value */ get uses(): Map<string, Set<string>>; /** * @returns A map with CFG node IDs as keys and their corresponding liveIn set as value */ get liveIn(): Map<string, Set<string>>; /** * @returns A map with CFG node IDs as keys and their corresponding liveOut set as value */ get liveOut(): Map<string, Set<string>>; } //# sourceMappingURL=LivenessAnalysis.d.ts.map