Skip to content

v2.65.0: Structurizer: ISA-neutral dominator-based structured control-flow pass.

Choose a tag to compare

@Ablation-Tool Ablation-Tool released this 10 Oct 22:27
· 254 commits to main since this release

Structurizer: ISA-neutral dominator-based structured control-flow pass.

New module: ablation/analyzers/structurizer.py.

3 things that were not possible before in Ablation:

  1. No structured output for any ISA. Every CFG-backed lifter produced
    goto-based IR. Structural reconstruction (if/while/for) was absent.
  2. No post-dominator tree. Post-dominators are needed to find the "join"
    point after an if/else diamond. PostDomTree fills this gap.
  3. No ISA-neutral decompiler pass. The structurizer works on any CFG that
    exposes .blocks, .entry, .flow, .flow_r() — the same interface as
    dataflow_engine.CFG. Any ISA CFG module can plug in.

New:

  • Structurizer(cfg): builds dominator tree + loop info + post-dominator tree,
    then walks RPO to emit WhileNode, IfNode, SequenceNode, ReturnNode,
    BreakNode, ContinueNode.
  • Structurizer.structure() -> StructuredNode: returns the tree.
  • Structurizer.emit(insn_emitter, func_name) -> str: renders to pseudo-C.
  • PostDomTree(cfg): immediate post-dominator tree via reversed-CFG DomTree.
    Used to find if/else join points.
  • All node types exported: SequenceNode, InsnNode, IfNode, WhileNode,
    BreakNode, ContinueNode, ReturnNode.
  • Docs: docs/module-reference/structurizer.md.