import type { AbsInsn2 } from "./insn" import type { Loc } from "./loc" export class BasicBlock { insns: Array constructor(insns: Array) { this.insns = insns } locs(): Set { return new Set( this.insns.flatMap(insn => { const insnLocs = [] if (insn.type === "copy" || insn.type === "unary") { insnLocs.push(insn.dest) if (typeof insn.source !== "number") { insnLocs.push(insn.source) } } return insnLocs }) ) } }