From 30d68d8906af22ba374b566fc8e5d5aabec09f47 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 7 Nov 2025 11:33:52 +0100 Subject: [PATCH] Java: Add missing deprecated annotations. --- java/ql/lib/semmle/code/java/dataflow/SSA.qll | 14 +++++++------- .../semmle/code/java/dataflow/internal/SsaImpl.qll | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/java/ql/lib/semmle/code/java/dataflow/SSA.qll b/java/ql/lib/semmle/code/java/dataflow/SSA.qll index 233b083a4ebc..a627904174b6 100644 --- a/java/ql/lib/semmle/code/java/dataflow/SSA.qll +++ b/java/ql/lib/semmle/code/java/dataflow/SSA.qll @@ -193,7 +193,7 @@ VarRead ssaGetAFirstUse(SsaDefinition def) { firstUse(def, result) } * * An SSA variable. */ -class SsaVariable extends Definition { +deprecated class SsaVariable extends Definition { /** Gets the SSA source variable underlying this SSA variable. */ SsaSourceVariable getSourceVariable() { result = super.getSourceVariable() } @@ -203,7 +203,7 @@ class SsaVariable extends Definition { * Gets the `ControlFlowNode` at which this SSA variable is defined. */ pragma[nomagic] - ControlFlowNode getCfgNode() { + deprecated ControlFlowNode getCfgNode() { exists(BasicBlock bb, int i | this.definesAt(_, bb, i) and // phi nodes are inserted at position `-1` @@ -225,7 +225,7 @@ class SsaVariable extends Definition { * * Gets an access of this SSA variable. */ - VarRead getAUse() { result = getAUse(this) } + deprecated VarRead getAUse() { result = getAUse(this) } /** * DEPRECATED: Use `ssaGetAFirstUse(SsaDefinition)` instead. @@ -272,7 +272,7 @@ class SsaVariable extends Definition { * * An SSA variable that either explicitly or implicitly updates the variable. */ -class SsaUpdate extends SsaVariable instanceof WriteDefinition { +deprecated class SsaUpdate extends SsaVariable instanceof WriteDefinition { SsaUpdate() { not this instanceof SsaImplicitInit } } @@ -281,7 +281,7 @@ class SsaUpdate extends SsaVariable instanceof WriteDefinition { * * An SSA variable that is defined by a `VariableUpdate`. */ -class SsaExplicitUpdate extends SsaUpdate { +deprecated class SsaExplicitUpdate extends SsaUpdate { private VariableUpdate upd; SsaExplicitUpdate() { ssaExplicitUpdate(this, upd) } @@ -409,7 +409,7 @@ deprecated class SsaUncertainImplicitUpdate extends SsaImplicitUpdate { * An SSA variable that is defined by its initial value in the callable. This * includes initial values of parameters, fields, and closure variables. */ -class SsaImplicitInit extends SsaVariable instanceof WriteDefinition { +deprecated class SsaImplicitInit extends SsaVariable instanceof WriteDefinition { SsaImplicitInit() { ssaImplicitInit(this) } override string toString() { result = "SSA init(" + this.getSourceVariable() + ")" } @@ -422,7 +422,7 @@ class SsaImplicitInit extends SsaVariable instanceof WriteDefinition { * * Holds if the SSA variable is a parameter defined by its initial value in the callable. */ - predicate isParameterDefinition(Parameter p) { + deprecated predicate isParameterDefinition(Parameter p) { this.getSourceVariable() = TLocalVar(p.getCallable(), p) and p.getCallable().getBody().getControlFlowNode() = this.getCfgNode() } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll index 21843f3e93be..624f82fd341d 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll @@ -244,7 +244,7 @@ final class UncertainWriteDefinition = Impl::UncertainWriteDefinition; final class PhiNode = Impl::PhiNode; -predicate ssaExplicitUpdate(SsaUpdate def, VariableUpdate upd) { +deprecated predicate ssaExplicitUpdate(SsaUpdate def, VariableUpdate upd) { exists(SsaSourceVariable v, BasicBlock bb, int i | def.definesAt(v, bb, i) and certainVariableUpdate(v, upd.getControlFlowNode(), bb, i) and @@ -259,7 +259,7 @@ deprecated predicate ssaUncertainImplicitUpdate(SsaImplicitUpdate def) { ) } -predicate ssaImplicitInit(WriteDefinition def) { +deprecated predicate ssaImplicitInit(WriteDefinition def) { exists(SsaSourceVariable v, BasicBlock bb, int i | def.definesAt(v, bb, i) and hasEntryDef(v, bb) and @@ -275,7 +275,7 @@ deprecated predicate ssaDefReachesUncertainDef(TrackedSsaDef def, SsaUncertainIm Impl::uncertainWriteDefinitionInput(redef, def) } -VarRead getAUse(Definition def) { +deprecated VarRead getAUse(Definition def) { exists(SsaSourceVariable v, BasicBlock bb, int i | Impl::ssaDefReachesRead(v, def, bb, i) and result.getControlFlowNode() = bb.getNode(i) and @@ -283,7 +283,7 @@ VarRead getAUse(Definition def) { ) } -predicate ssaDefReachesEndOfBlock(BasicBlock bb, Definition def) { +deprecated predicate ssaDefReachesEndOfBlock(BasicBlock bb, Definition def) { Impl::ssaDefReachesEndOfBlock(bb, def, _) }