/** * ExceptionFlowGraph — lightweight wrapper over CFG exception edges. * * The CFG builder emits edges with `type === 'exception'` connecting the * first block of a try body (`from`) to the first block of the corresponding * catch handler (`to`). This class indexes those edges so exception-aware * passes can query try/catch structure without re-scanning the edge list. */ import type { CFG, CFGBlock } from '../types/index.js'; export interface TryCatchInfo { tryEntryId: number; catchEntryId: number; /** First block of the try body. */ tryBlock: CFGBlock; /** First block of the catch handler. */ catchBlock: CFGBlock; } export declare class ExceptionFlowGraph { /** All try/catch pairs found in the CFG. */ readonly pairs: TryCatchInfo[]; /** Block IDs that are catch-handler entry blocks. */ readonly catchEntryIds: Set; /** Block IDs that are try-body entry blocks. */ readonly tryEntryIds: Set; private readonly tryCatchMap; private readonly catchTryMap; constructor(cfg: CFG, blockById: Map); /** True if at least one try/catch pair was found. */ get hasTryCatch(): boolean; /** True if the given block ID is a catch-handler entry block. */ isCatchEntry(blockId: number): boolean; /** True if the given block ID is a try-body entry block. */ isTryEntry(blockId: number): boolean; /** * Returns the catch-entry block IDs for the given try-entry block. * Multiple values mean multiple catch clauses for the same try. */ catchBlocksFor(tryEntryId: number): number[]; /** * Returns the try-entry block ID corresponding to a catch-entry block, * or `undefined` if the block is not a catch entry. */ tryBlockFor(catchEntryId: number): number | undefined; } //# sourceMappingURL=exception-flow-graph.d.ts.map