Skip to content

C++: Expose indirect instructions and indirect parameters in dataflow#21552

Merged
MathiasVP merged 5 commits intogithub:mainfrom
MathiasVP:more-public-dataflow-apis
Mar 23, 2026
Merged

C++: Expose indirect instructions and indirect parameters in dataflow#21552
MathiasVP merged 5 commits intogithub:mainfrom
MathiasVP:more-public-dataflow-apis

Conversation

@MathiasVP
Copy link
Contributor

This PR exposes two concepts that we use all the time internally in C/C++ dataflow to the public API:

  • 09caeca moves IndirectParameterNode to the public API. Right now, it's impossible to select the indirection of a parameter as a dataflow node in queries.
  • 1363c54 adds an asIndirectInstruction predicate to DataFlow::Node similar to how we have asIndirectOperand. Temporarily adding this predicate is quite a common thing for me to do locally when I write queries, and we might as well make this available to everyone else to match what we have for indirect operands.

@MathiasVP MathiasVP requested a review from a team as a code owner March 23, 2026 13:32
Copilot AI review requested due to automatic review settings March 23, 2026 13:32
@github-actions github-actions bot added the C++ label Mar 23, 2026
jketema
jketema previously approved these changes Mar 23, 2026
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe run some DCA just to be on the safe side.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the public C/C++ IR dataflow API to make common internal dataflow concepts available to query authors, specifically indirect instructions and indirect parameter nodes.

Changes:

  • Expose IndirectParameterNode in the public DataFlowNodes API.
  • Add DataFlow::Node.asIndirectInstruction(int index) to mirror existing indirect-operand support.

@MathiasVP
Copy link
Contributor Author

LGTM. Maybe run some DCA just to be on the safe side.

Thanks for the quick approval. Will do. I'm still writing the change note and I'll start a DCA once I've pushed that

Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

LGTM (conditions from above apply 😄)

@MathiasVP
Copy link
Contributor Author

DCA was uneventful (as expected).

@MathiasVP MathiasVP merged commit 680ea0b into github:main Mar 23, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants