Skip to content

Conversation

@aschackmull
Copy link
Contributor

@aschackmull aschackmull commented Nov 5, 2025

This migrates the Java SSA libraries to use the shared SSA wrapper classes.

Commit-by-commit review is very much encouraged.


import java
private import internal.SsaImpl
import internal.SsaImpl::Ssa as Ssa

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Ssa is only different by casing from SSA that is used elsewhere for modules.
}

private predicate upcastEnhancedForStmtAux(BaseSsaUpdate v, RefType t, RefType t1, RefType t2) {
private predicate upcastEnhancedForStmtAux(

Check warning

Code scanning / CodeQL

Candidate predicate not marked as `nomagic` Warning

Candidate predicate to
upcastEnhancedForStmt
is not marked as nomagic.
i = 0
)
}
module Ssa = Impl::MakeSsa<SsaInput>;

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Ssa is only different by casing from SSA that is used elsewhere for modules.
}
}

module Ssa = Impl::MakeSsa<SsaInput>;

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Ssa is only different by casing from SSA that is used elsewhere for modules.
@aschackmull aschackmull force-pushed the java/ssa-shared branch 2 times, most recently from 820021e to aad896a Compare November 7, 2025 08:02
@aschackmull
Copy link
Contributor Author

I've left several deprecation annotations for a followup PR to avoid having to do a submodule bump here.

@aschackmull aschackmull marked this pull request as ready for review November 7, 2025 11:51
@aschackmull aschackmull requested a review from a team as a code owner November 7, 2025 11:51
Copilot AI review requested due to automatic review settings November 7, 2025 11:51
@aschackmull aschackmull requested a review from a team as a code owner November 7, 2025 11:51
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 modernizes the SSA (Static Single Assignment) API for Java CodeQL by renaming classes and methods to improve clarity and consistency. The changes deprecate old class and method names while introducing clearer alternatives.

  • Renames core SSA classes (e.g., SsaVariableSsaDefinition, SsaPhiNodeSsaPhiDefinition)
  • Renames methods for consistency (e.g., getAUse()getARead(), getCfgNode()getControlFlowNode())
  • Introduces new specialized SSA classes with clearer semantics (SsaCapturedDefinition, SsaImplicitCallDefinition, etc.)

Reviewed Changes

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

Show a summary per file
File Description
shared/ssa/codeql/ssa/Ssa.qll Adds toString methods and renames SsaPhiDefinition class definition
java/ql/lib/semmle/code/java/dataflow/SSA.qll Core SSA API with renamed classes and deprecated old names
java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll Base SSA implementation updated with new class names
java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll Internal SSA implementation restructuring
java/ql/test/**/*.ql Test queries updated to use new API
java/ql/test/**/*.expected Generated test expectations updated with new toString formats
java/ql/lib/**/*.qll Various library files updated to use new API
java/ql/src/**/*.qll Source queries updated to use new API
java/ql/lib/semmle/code/java/Expr.qll Adds new VariableWrite class for SSA integration
java/ql/lib/change-notes/2025-10-07-ssa-api-updates.md Documents the deprecation of old SSA API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant