Skip to content

Commit 18d3b3b

Browse files
committed
C#: Deprecate Ssa::ImplicitDefinition.
1 parent 95c0288 commit 18d3b3b

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
@@ -519,13 +519,15 @@ module Ssa {
519519
}
520520

521521
/**
522+
* DEPRECATED: Use `SsaParameterInit` or `SsaImplicitWrite` instead.
523+
*
522524
* An SSA definition that does not correspond to an explicit variable definition.
523525
* Either an implicit initialization of a variable at the beginning of a callable
524526
* (`ImplicitEntryDefinition`), an implicit definition via a call
525527
* (`ImplicitCallDefinition`), or an implicit definition where the qualifier is
526528
* updated (`ImplicitQualifierDefinition`).
527529
*/
528-
class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
530+
deprecated class ImplicitDefinition extends Definition, SsaImpl::WriteDefinition {
529531
ImplicitDefinition() {
530532
exists(BasicBlock bb, SourceVariable v, int i | this.definesAt(v, bb, i) |
531533
SsaImpl::implicitEntryDefinition(bb, v) and
@@ -603,7 +605,7 @@ module Ssa {
603605
* An SSA definition representing the potential definition of a variable
604606
* via a call.
605607
*/
606-
class ImplicitCallDefinition extends ImplicitDefinition {
608+
class ImplicitCallDefinition extends SsaImplicitWrite {
607609
private Call c;
608610

609611
ImplicitCallDefinition() {
@@ -636,7 +638,7 @@ module Ssa {
636638
* An SSA definition representing the potential definition of a variable
637639
* via an SSA definition for the qualifier.
638640
*/
639-
class ImplicitQualifierDefinition extends ImplicitDefinition, SsaImpl::WriteDefinition {
641+
class ImplicitQualifierDefinition extends SsaImplicitWrite {
640642
private Definition q;
641643

642644
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
@@ -1993,9 +1993,9 @@ private class FieldOrPropertyRead extends FieldOrPropertyAccess, AssignableRead
19931993
* SSA updates.
19941994
*/
19951995
predicate hasNonlocalValue() {
1996-
exists(SsaDefinition def, Ssa::ImplicitDefinition idef |
1996+
exists(SsaDefinition def |
19971997
def.getARead() = this and
1998-
idef = def.getAnUltimateDefinition()
1998+
def.getAnUltimateDefinition() instanceof SsaImplicitWrite
19991999
)
20002000
}
20012001
}

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)