Skip to content

Commit de96b5a

Browse files
committed
C#: Deprecate Ssa::ImplicitDefinition.
1 parent 80d5e27 commit de96b5a

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,15 @@ module Ssa {
509509
}
510510

511511
/**
512+
* DEPRECATED: Use `SsaParameterInit` or `SsaImplicitWrite` instead.
513+
*
512514
* An SSA definition that does not correspond to an explicit variable definition.
513515
* Either an implicit initialization of a variable at the beginning of a callable
514516
* (`ImplicitEntryDefinition`), an implicit definition via a call
515517
* (`ImplicitCallDefinition`), or an implicit definition where the qualifier is
516518
* updated (`ImplicitQualifierDefinition`).
517519
*/
518-
class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
520+
deprecated class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
519521
ImplicitDefinition() {
520522
exists(BasicBlock bb, SourceVariable v, int i | this.definesAt(v, bb, i) |
521523
SsaImpl::implicitEntryDefinition(bb, v) and
@@ -596,7 +598,7 @@ module Ssa {
596598
* An SSA definition representing the potential definition of a variable
597599
* via a call.
598600
*/
599-
class ImplicitCallDefinition extends ImplicitDefinition {
601+
class ImplicitCallDefinition extends SsaImplicitWrite {
600602
private Call c;
601603

602604
ImplicitCallDefinition() {
@@ -629,7 +631,7 @@ module Ssa {
629631
* An SSA definition representing the potential definition of a variable
630632
* via an SSA definition for the qualifier.
631633
*/
632-
class ImplicitQualifierDefinition extends ImplicitDefinition, SsaImpl::WriteDefinition {
634+
class ImplicitQualifierDefinition extends SsaImplicitWrite {
633635
private Definition q;
634636

635637
ImplicitQualifierDefinition() {

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,9 +2008,9 @@ private class FieldOrPropertyRead extends FieldOrPropertyAccess, AssignableRead
20082008
* SSA updates.
20092009
*/
20102010
predicate hasNonlocalValue() {
2011-
exists(SsaDefinition def, Ssa::ImplicitDefinition idef |
2011+
exists(SsaDefinition def |
20122012
def.getARead() = this and
2013-
idef = def.getAnUltimateDefinition()
2013+
def.getAnUltimateDefinition() instanceof SsaImplicitWrite
20142014
)
20152015
}
20162016
}

csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ private module Impl {
144144
}
145145

146146
/** Gets the variable underlying the implicit SSA variable `def`. */
147-
Declaration getImplicitSsaDeclaration(Ssa::ImplicitDefinition def) {
147+
Declaration getImplicitSsaDeclaration(SsaImplicitWrite def) {
148148
result = def.getSourceVariable().getAssignable()
149149
}
150150

151151
/** Holds if the variable underlying the implicit SSA variable `def` is not a field. */
152-
predicate nonFieldImplicitSsaDefinition(Ssa::ImplicitDefinition def) {
152+
predicate nonFieldImplicitSsaDefinition(SsaImplicitWrite def) {
153153
not getImplicitSsaDeclaration(def) instanceof Field
154154
}
155155

0 commit comments

Comments
 (0)