Skip to content

C#: Replace BaseSSA classes with shared code.#21744

Merged
aschackmull merged 5 commits intogithub:mainfrom
aschackmull:csharp/ssa
Apr 23, 2026
Merged

C#: Replace BaseSSA classes with shared code.#21744
aschackmull merged 5 commits intogithub:mainfrom
aschackmull:csharp/ssa

Conversation

@aschackmull
Copy link
Copy Markdown
Contributor

@aschackmull aschackmull commented Apr 22, 2026

This aligns the C# BaseSSA classes with the shared SSA signature by using the classes provided by the shared library.

@github-actions github-actions Bot added the C# label Apr 22, 2026
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Apr 23, 2026
@aschackmull aschackmull marked this pull request as ready for review April 23, 2026 07:04
@aschackmull aschackmull requested a review from a team as a code owner April 23, 2026 07:04
Copilot AI review requested due to automatic review settings April 23, 2026 07:04
@aschackmull
Copy link
Copy Markdown
Contributor Author

Dca is uneventful.

Copy link
Copy Markdown
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

Aligns the C# BaseSSA implementation with the shared (language-independent) SSA signature by switching to the shared library’s SSA classes and adapting downstream uses accordingly.

Changes:

  • Refactors BaseSSA.qll to implement the shared SSA input/signature and re-export the shared SSA types.
  • Updates internal consumers (Dispatch.qll, Steps.qll) to use the new shared SSA class names/types.
  • Adjusts the SSA consistency library test to match the new explicit/implicit definition split.
Show a summary per file
File Description
csharp/ql/test/library-tests/dataflow/ssa/BaseSsaConsistency.ql Updates the test query to use shared SSA write/parameter-init definition types.
csharp/ql/lib/semmle/code/csharp/dispatch/Dispatch.qll Switches parameter-entry detection to shared BaseSsa::SsaParameterInit.
csharp/ql/lib/semmle/code/csharp/dataflow/internal/Steps.qll Updates definition-to-read resolution to use shared SsaDefinition/SsaExplicitWrite.
csharp/ql/lib/semmle/code/csharp/dataflow/internal/BaseSSA.qll Replaces custom Definition/PhiNode wrappers with shared SSA construction and types.

Copilot's findings

Comments suppressed due to low confidence (1)

csharp/ql/lib/semmle/code/csharp/dataflow/internal/BaseSSA.qll:43

  • The comment inside entryDef still describes this as an “implicit entry definition” (and explains implicitEntryDef-style behavior). Since the predicate has been renamed to entryDef and now also seems to be used for parameter initialization, consider updating the wording to match the new terminology to avoid confusion for future maintainers.
      // In case `c` has multiple bodies, we want each body to get its own implicit
      // entry definition. In case `c` doesn't have multiple bodies, the line below
      // is simply the same as `bb = entry`, because `entry.getFirstNode().getASuccessor()`
      // will be in the entry block.
      bb = entry.getFirstNode().getASuccessor().getBasicBlock() and
  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@aschackmull aschackmull merged commit cb21044 into github:main Apr 23, 2026
29 checks passed
@aschackmull aschackmull deleted the csharp/ssa branch April 23, 2026 12:39
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.

3 participants