C#: Replace BaseSSA classes with shared code.#21744
Merged
aschackmull merged 5 commits intogithub:mainfrom Apr 23, 2026
Merged
Conversation
Contributor
Author
|
Dca is uneventful. |
Contributor
There was a problem hiding this comment.
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.qllto 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
entryDefstill describes this as an “implicit entry definition” (and explainsimplicitEntryDef-style behavior). Since the predicate has been renamed toentryDefand 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
hvitved
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This aligns the C# BaseSSA classes with the shared SSA signature by using the classes provided by the shared library.