C#: Deprecate Ssa::ImplicitDefinition.

This commit is contained in:
Anders Schack-Mulligen
2026-04-28 11:15:13 +02:00
parent 80d5e27b46
commit de96b5acfd
3 changed files with 9 additions and 7 deletions

View File

@@ -509,13 +509,15 @@ module Ssa {
}
/**
* DEPRECATED: Use `SsaParameterInit` or `SsaImplicitWrite` instead.
*
* An SSA definition that does not correspond to an explicit variable definition.
* Either an implicit initialization of a variable at the beginning of a callable
* (`ImplicitEntryDefinition`), an implicit definition via a call
* (`ImplicitCallDefinition`), or an implicit definition where the qualifier is
* updated (`ImplicitQualifierDefinition`).
*/
class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
deprecated class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
ImplicitDefinition() {
exists(BasicBlock bb, SourceVariable v, int i | this.definesAt(v, bb, i) |
SsaImpl::implicitEntryDefinition(bb, v) and
@@ -596,7 +598,7 @@ module Ssa {
* An SSA definition representing the potential definition of a variable
* via a call.
*/
class ImplicitCallDefinition extends ImplicitDefinition {
class ImplicitCallDefinition extends SsaImplicitWrite {
private Call c;
ImplicitCallDefinition() {
@@ -629,7 +631,7 @@ module Ssa {
* An SSA definition representing the potential definition of a variable
* via an SSA definition for the qualifier.
*/
class ImplicitQualifierDefinition extends ImplicitDefinition, SsaImpl::WriteDefinition {
class ImplicitQualifierDefinition extends SsaImplicitWrite {
private Definition q;
ImplicitQualifierDefinition() {

View File

@@ -2008,9 +2008,9 @@ private class FieldOrPropertyRead extends FieldOrPropertyAccess, AssignableRead
* SSA updates.
*/
predicate hasNonlocalValue() {
exists(SsaDefinition def, Ssa::ImplicitDefinition idef |
exists(SsaDefinition def |
def.getARead() = this and
idef = def.getAnUltimateDefinition()
def.getAnUltimateDefinition() instanceof SsaImplicitWrite
)
}
}

View File

@@ -144,12 +144,12 @@ private module Impl {
}
/** Gets the variable underlying the implicit SSA variable `def`. */
Declaration getImplicitSsaDeclaration(Ssa::ImplicitDefinition def) {
Declaration getImplicitSsaDeclaration(SsaImplicitWrite def) {
result = def.getSourceVariable().getAssignable()
}
/** Holds if the variable underlying the implicit SSA variable `def` is not a field. */
predicate nonFieldImplicitSsaDefinition(Ssa::ImplicitDefinition def) {
predicate nonFieldImplicitSsaDefinition(SsaImplicitWrite def) {
not getImplicitSsaDeclaration(def) instanceof Field
}