Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSA: Replace the Guards interface in the SSA data flow integration. #18934

Merged
merged 3 commits into from
Mar 6, 2025

Conversation

aschackmull
Copy link
Contributor

One small cleanup commit for Ruby, and then the primary commit, which updates the Guards-related part of the SSA data flow integration module interface. This should be equivalent, but removes the implicit assumption that guards coincide with the CFG node where the branching happens, this is e.g. false if we want to support indirect guards through a local boolean variable in the SSA interface.

b = someGuard;
...
if (b) ...

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Mar 5, 2025
@Copilot Copilot bot review requested due to automatic review settings March 5, 2025 13:40
@aschackmull aschackmull requested review from a team as code owners March 5, 2025 13:40

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@github-actions github-actions bot added C# JS Java Ruby Rust Pull requests that update Rust code labels Mar 5, 2025
@aschackmull
Copy link
Contributor Author

Dca is completely uneventful.

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

One minor suggestion, otherwise LGTM.

@@ -421,7 +421,7 @@ import Cached
*
* Only intended for internal use.
*/
class DefinitionExt extends Impl::DefinitionExt {
deprecated class DefinitionExt extends Impl::DefinitionExt {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these are inside an internal folder, and has the Only intended for internal use comment, it should be fine to simply delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're actually used in a couple of deprecated predicates that ultimately end up in the public getALastRead member predicate on Definition in the outwards-facing SSA.qll, so it's less clear cut. That's why I left them in for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can make it private, though, and possibly push in enough casts from DefinitionExt to Definition that we might be able to eliminate it. Let me check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. All the uses of DefinitionExt here were actually in contexts for which we could push a context with a cast to Definition. So I'll be able to delete this. Commit incoming.

@aschackmull aschackmull merged commit da579c2 into github:main Mar 6, 2025
55 checks passed
@aschackmull aschackmull deleted the ssa/refactor5 branch March 6, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Java JS no-change-note-required This PR does not need a change note Ruby Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants