Skip to content

Unified: Also construct CFGs for generated callables - #23352

Open
hvitved wants to merge 2 commits into
github:mainfrom
hvitved:unified/cfg-generated-callables
Open

hvitved wants to merge 2 commits into
github:mainfrom
hvitved:unified/cfg-generated-callables

Conversation

@hvitved

@hvitved hvitved commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

The first commit is best reviewed ignoring whitespaces.

Comment on lines +188 to +190
if Input::getParent+(a2) = a1
then dir = Down()
else none()
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Dec 3, 2026
@hvitved
hvitved force-pushed the unified/cfg-generated-callables branch from ee697e3 to 4c255d5 Compare December 3, 2026 19:31
@hvitved
hvitved marked this pull request as ready for review December 3, 2026 19:45
@hvitved
hvitved requested review from a team as code owners December 3, 2026 19:45
Copilot AI adaptive review requested due to automatic review settings December 3, 2026 19:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Expanding CFG membership to generated AST nodes and callables changes downstream SSA and data-flow assumptions while CaptureSsa remains source-only, requiring broader review of these interacting analysis contracts.

No open issues 🎉

What changed in this PR

Extends unified control-flow graph construction to generated callables in source files, while keeping inline CFG tests focused on source-written callables.

Changes:

  • Includes generated callables and AST nodes from source files.
  • Adds callable filtering to shared CFG test helpers.
  • Updates expected basic-block slices for generated Swift initializers.
File Description
unified/​ql/​test/​library-tests/​controlflow/​cfg.ql Restricts inline checks to source-written, non-top-level callables.
unified/​ql/​test/​library-tests/​controlflow/​basicblock-slices.expected Adds expected slices for generated initializers.
unified/​ql/​lib/​codeql/​unified/​internal/​ControlFlowGraph.qll Uses file-level source checks to include generated nodes.
shared/​controlflow/​codeql/​controlflow/​test/​TestCfg.qll Adds optional callable filtering while preserving unrestricted defaults.

Review effort: Balanced (adaptive)

@hvitved
hvitved force-pushed the unified/cfg-generated-callables branch from 4c255d5 to 41992f6 Compare December 3, 2026 19:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants