Skip to content

Commit 5a0fc12

Browse files
committed
Java: Deprecate two more SSA classes.
1 parent a5cd198 commit 5a0fc12

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,14 @@ class SsaExplicitUpdate extends SsaUpdate {
293293
}
294294

295295
/**
296+
* DEPRECATED: Use `SsaImplicitWrite` instead.
297+
*
296298
* An SSA variable that represents any sort of implicit update. This can be a
297299
* `Call` that might reach a non-local update of the field, an explicit or
298300
* implicit update of the qualifier of the field, or the implicit update that
299301
* occurs just prior to a `FieldRead` of an untracked field.
300302
*/
301-
class SsaImplicitUpdate extends SsaUpdate {
303+
deprecated class SsaImplicitUpdate extends SsaUpdate {
302304
SsaImplicitUpdate() { not this instanceof SsaExplicitUpdate }
303305

304306
override string toString() {
@@ -383,18 +385,22 @@ private predicate isNonLocalImpl(SsaImplicitWrite calldef) { exists(getANonLocal
383385
private predicate isNonLocal(SsaImplicitWrite calldef) = forceLocal(isNonLocalImpl/1)(calldef)
384386

385387
/**
388+
* DEPRECATED: Use `SsaUncertainWrite` instead.
389+
*
386390
* An SSA variable that represents an uncertain implicit update of the value.
387391
* This is a `Call` that might reach a non-local update of the field or one of
388392
* its qualifiers.
389393
*/
390-
class SsaUncertainImplicitUpdate extends SsaImplicitUpdate {
394+
deprecated class SsaUncertainImplicitUpdate extends SsaImplicitUpdate {
391395
SsaUncertainImplicitUpdate() { ssaUncertainImplicitUpdate(this) }
392396

393397
/**
398+
* DEPRECATED: Use `getPriorDefinition()` instead.
399+
*
394400
* Gets the immediately preceding definition. Since this update is uncertain
395401
* the value from the preceding definition might still be valid.
396402
*/
397-
SsaVariable getPriorDef() { ssaDefReachesUncertainDef(result, this) }
403+
deprecated SsaVariable getPriorDef() { ssaDefReachesUncertainDef(result, this) }
398404
}
399405

400406
/**

java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ private module Cached {
486486

487487
overlay[global]
488488
cached
489-
predicate defUpdatesNamedField(SsaImplicitUpdate def, TrackedField f, Callable setter) {
489+
predicate defUpdatesNamedField(SsaImplicitWrite def, TrackedField f, Callable setter) {
490490
f = def.getSourceVariable() and
491-
updatesNamedField0(def.getCfgNode().asCall(), f, setter)
491+
updatesNamedField0(def.getControlFlowNode().asCall(), f, setter)
492492
}
493493

494494
cached
495-
predicate ssaUncertainImplicitUpdate(SsaImplicitUpdate def) {
495+
deprecated predicate ssaUncertainImplicitUpdate(SsaImplicitUpdate def) {
496496
exists(SsaSourceVariable v, BasicBlock bb, int i |
497497
def.definesAt(v, bb, i) and
498498
uncertainVariableUpdate(v, _, bb, i)
@@ -522,7 +522,7 @@ private module Cached {
522522
* SSA definition of `v`.
523523
*/
524524
cached
525-
predicate ssaDefReachesUncertainDef(TrackedSsaDef def, SsaUncertainImplicitUpdate redef) {
525+
deprecated predicate ssaDefReachesUncertainDef(TrackedSsaDef def, SsaUncertainImplicitUpdate redef) {
526526
Impl::uncertainWriteDefinitionInput(redef, def)
527527
}
528528

@@ -671,7 +671,7 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
671671
predicate ssaDefHasSource(WriteDefinition def) { def instanceof SsaExplicitWrite }
672672

673673
predicate allowFlowIntoUncertainDef(UncertainWriteDefinition def) {
674-
def instanceof SsaUncertainImplicitUpdate
674+
def instanceof SsaUncertainWrite
675675
}
676676

677677
class GuardValue = Guards::GuardValue;

0 commit comments

Comments
 (0)