Skip to content

Control flow analysis infrastructure #18

@rockorager

Description

@rockorager

Overview

Build a control flow graph (CFG) for Zig functions to enable path-sensitive lint rules.

What it unlocks

What's involved

  • Build a CFG from the AST — basic blocks connected by edges for branches (if, switch, while, for), break, continue, return, try/catch
  • Handle Zig-specific constructserrdefer, defer, comptime branches, labeled blocks
  • Path analysis — walk all paths for "does X happen on every/any path" questions

ZIR may help since it linearizes some of these constructs already.

Status

Not yet committed to. Tracking this so rules that need it have a place to point to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions