Skip to content

C++: Introduce a pre-SSA DataFlow::Node class#11541

Merged
MathiasVP merged 2 commits into
github:mathiasvp/replace-ast-with-ir-use-usedataflowfrom
MathiasVP:add-node0
Dec 6, 2022
Merged

C++: Introduce a pre-SSA DataFlow::Node class#11541
MathiasVP merged 2 commits into
github:mathiasvp/replace-ast-with-ir-use-usedataflowfrom
MathiasVP:add-node0

Conversation

@MathiasVP
Copy link
Copy Markdown
Contributor

This is a simple refactoring that introduces a Node class that exists before computing any SSA. This is a necessary step for my ongoing work on IR dataflow through iterators.

@MathiasVP MathiasVP requested a review from a team as a code owner December 2, 2022 10:06
@github-actions github-actions Bot added the C++ label Dec 2, 2022
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Dec 2, 2022
Copy link
Copy Markdown
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.

Two small comments to help my understanding. Otherwise LGTM.


override Declaration getEnclosingCallable() { result = this.getFunction() }

override Declaration getFunction() { result = op.getUse().getEnclosingFunction() }
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.

Is there a particular reason for picking getUse here, and got getDef? I suspect it doesn't matter much either way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, that shouldn't matter. I hope the definition and the use of an operand has the same enclosing function. Otherwise, I think we're dealing with a very inconsistent DB 😱.

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.

Good. getDef would make slightly more sense to me, but that's just nitpicking, so I'll leave it to you whether to change it or not.

@MathiasVP MathiasVP merged commit e71fbb1 into github:mathiasvp/replace-ast-with-ir-use-usedataflow Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants