@@ -188,178 +188,6 @@ class SsaImplicitQualifierDefinition extends SsaImplicitWrite {
188188 */
189189VarRead ssaGetAFirstUse ( SsaDefinition def ) { firstUse ( def , result ) }
190190
191- /**
192- * DEPRECATED: use `SsaDefinition` instead.
193- *
194- * An SSA variable.
195- */
196- deprecated class SsaVariable extends Definition {
197- /** Gets the SSA source variable underlying this SSA variable. */
198- SsaSourceVariable getSourceVariable ( ) { result = super .getSourceVariable ( ) }
199-
200- /**
201- * DEPRECATED: Use `getControlFlowNode()` instead.
202- *
203- * Gets the `ControlFlowNode` at which this SSA variable is defined.
204- */
205- pragma [ nomagic]
206- deprecated ControlFlowNode getCfgNode ( ) {
207- exists ( BasicBlock bb , int i |
208- this .definesAt ( _, bb , i ) and
209- // phi nodes are inserted at position `-1`
210- result = bb .getNode ( 0 .maximum ( i ) )
211- )
212- }
213-
214- /** Gets a textual representation of this SSA variable. */
215- string toString ( ) { none ( ) }
216-
217- /** Gets the source location for this element. */
218- Location getLocation ( ) { result = this .getCfgNode ( ) .getLocation ( ) }
219-
220- /** Gets the `BasicBlock` in which this SSA variable is defined. */
221- BasicBlock getBasicBlock ( ) { result = super .getBasicBlock ( ) }
222-
223- /**
224- * DEPRECATED: Use `getARead()` instead.
225- *
226- * Gets an access of this SSA variable.
227- */
228- deprecated VarRead getAUse ( ) { result = getAUse ( this ) }
229-
230- /**
231- * DEPRECATED: Use `ssaGetAFirstUse(SsaDefinition)` instead.
232- *
233- * Gets an access of the SSA source variable underlying this SSA variable
234- * that can be reached from this SSA variable without passing through any
235- * other uses, but potentially through phi nodes and uncertain implicit
236- * updates.
237- *
238- * Subsequent uses can be found by following the steps defined by
239- * `adjacentUseUse`.
240- */
241- deprecated VarRead getAFirstUse ( ) { firstUse ( this , result ) }
242-
243- /** Holds if this SSA variable is live at the end of `b`. */
244- predicate isLiveAtEndOfBlock ( BasicBlock b ) { ssaDefReachesEndOfBlock ( b , this ) }
245-
246- /**
247- * DEPRECATED.
248- *
249- * Gets an SSA variable whose value can flow to this one in one step. This
250- * includes inputs to phi nodes, the prior definition of uncertain updates,
251- * and the captured ssa variable for a closure variable.
252- */
253- deprecated SsaVariable getAPhiInputOrPriorDef ( ) {
254- result = this .( SsaPhiNode ) .getAPhiInput ( ) or
255- result = this .( SsaUncertainImplicitUpdate ) .getPriorDef ( ) or
256- this .( SsaImplicitInit ) .captures ( result )
257- }
258-
259- /**
260- * DEPRECATED: Use `SsaCapturedDefinition::getAnUltimateCapturedDefinition()`
261- * and/or `SsaDefinition::getAnUltimateDefinition()` instead.
262- *
263- * Gets a definition that ultimately defines this variable and is not itself a phi node.
264- */
265- deprecated SsaVariable getAnUltimateDefinition ( ) {
266- result = this .getAPhiInputOrPriorDef * ( ) and not result instanceof SsaPhiNode
267- }
268- }
269-
270- /**
271- * DEPRECATED: use `SsaWriteDefinition` instead.
272- *
273- * An SSA variable that either explicitly or implicitly updates the variable.
274- */
275- deprecated class SsaUpdate extends SsaVariable instanceof WriteDefinition {
276- SsaUpdate ( ) { not this instanceof SsaImplicitInit }
277- }
278-
279- /**
280- * DEPRECATED: Use `SsaExplicitWrite` instead.
281- *
282- * An SSA variable that is defined by a `VariableUpdate`.
283- */
284- deprecated class SsaExplicitUpdate extends SsaUpdate {
285- private VariableUpdate upd ;
286-
287- SsaExplicitUpdate ( ) { ssaExplicitUpdate ( this , upd ) }
288-
289- override string toString ( ) { result = "SSA def(" + this .getSourceVariable ( ) + ")" }
290-
291- /** Gets the `VariableUpdate` defining the SSA variable. */
292- VariableUpdate getDefiningExpr ( ) { result = upd }
293- }
294-
295- /**
296- * DEPRECATED: Use `SsaImplicitWrite` instead.
297- *
298- * An SSA variable that represents any sort of implicit update. This can be a
299- * `Call` that might reach a non-local update of the field, an explicit or
300- * implicit update of the qualifier of the field, or the implicit update that
301- * occurs just prior to a `FieldRead` of an untracked field.
302- */
303- deprecated class SsaImplicitUpdate extends SsaUpdate {
304- SsaImplicitUpdate ( ) { not this instanceof SsaExplicitUpdate }
305-
306- override string toString ( ) {
307- result = "SSA impl upd[" + this .getKind ( ) + "](" + this .getSourceVariable ( ) + ")"
308- }
309-
310- private predicate hasExplicitQualifierUpdate ( ) {
311- exists ( SsaUpdate qdef , BasicBlock bb , int i |
312- qdef .definesAt ( this .getSourceVariable ( ) .getQualifier ( ) , bb , i ) and
313- this .definesAt ( _, bb , i ) and
314- not qdef instanceof SsaUncertainImplicitUpdate
315- )
316- }
317-
318- private predicate hasImplicitQualifierUpdate ( ) {
319- exists ( SsaUncertainImplicitUpdate qdef , BasicBlock bb , int i |
320- qdef .definesAt ( this .getSourceVariable ( ) .getQualifier ( ) , bb , i ) and
321- this .definesAt ( _, bb , i )
322- )
323- }
324-
325- private string getKind ( ) {
326- this .hasExplicitQualifierUpdate ( ) and
327- result = "explicit qualifier" // -> SSA qualifier def
328- or
329- if this .hasImplicitQualifierUpdate ( )
330- then
331- if isNonLocal ( this )
332- then result = "nonlocal + nonlocal qualifier" // -> SSA qualifier def
333- else result = "nonlocal qualifier" // -> SSA qualifier def
334- else (
335- isNonLocal ( this ) and result = "nonlocal" // -> SSA call def
336- )
337- }
338-
339- /**
340- * DEPRECATED: Use `SsaImplicitCallDefinition.getANonLocalUpdate()` instead.
341- *
342- * Gets a reachable `FieldWrite` that might represent this ssa update, if any.
343- */
344- overlay [ global]
345- deprecated FieldWrite getANonLocalUpdate ( ) { result = getANonLocalUpdate ( this ) }
346-
347- /**
348- * DEPRECATED: Use `SsaImplicitQualifierDefinition` instead.
349- *
350- * Holds if this ssa variable might change the value to something unknown.
351- *
352- * Examples include updates that might change the value of the qualifier, or
353- * reads from untracked variables, for example those where the field or one
354- * of its qualifiers is volatile.
355- */
356- deprecated predicate assignsUnknownValue ( ) {
357- this .hasExplicitQualifierUpdate ( )
358- or
359- this .hasImplicitQualifierUpdate ( )
360- }
361- }
362-
363191private predicate hasQualifierUpdate ( SsaImplicitWrite def ) {
364192 exists ( SsaWriteDefinition qdef , BasicBlock bb , int i |
365193 qdef .definesAt ( def .getSourceVariable ( ) .getQualifier ( ) , bb , i ) and
@@ -384,74 +212,6 @@ private predicate isNonLocalImpl(SsaImplicitWrite calldef) { exists(getANonLocal
384212
385213private predicate isNonLocal ( SsaImplicitWrite calldef ) = forceLocal( isNonLocalImpl / 1 ) ( calldef )
386214
387- /**
388- * DEPRECATED: Use `SsaUncertainWrite` instead.
389- *
390- * An SSA variable that represents an uncertain implicit update of the value.
391- * This is a `Call` that might reach a non-local update of the field or one of
392- * its qualifiers.
393- */
394- deprecated class SsaUncertainImplicitUpdate extends SsaImplicitUpdate {
395- SsaUncertainImplicitUpdate ( ) { ssaUncertainImplicitUpdate ( this ) }
396-
397- /**
398- * DEPRECATED: Use `getPriorDefinition()` instead.
399- *
400- * Gets the immediately preceding definition. Since this update is uncertain
401- * the value from the preceding definition might still be valid.
402- */
403- deprecated SsaVariable getPriorDef ( ) { ssaDefReachesUncertainDef ( result , this ) }
404- }
405-
406- /**
407- * DEPRECATED: Use `SsaParameterInit`, `SsaImplicitEntryDefinition`, or `SsaCapturedDefinition` instead.
408- *
409- * An SSA variable that is defined by its initial value in the callable. This
410- * includes initial values of parameters, fields, and closure variables.
411- */
412- deprecated class SsaImplicitInit extends SsaVariable instanceof WriteDefinition {
413- SsaImplicitInit ( ) { ssaImplicitInit ( this ) }
414-
415- override string toString ( ) { result = "SSA init(" + this .getSourceVariable ( ) + ")" }
416-
417- /** Holds if this is a closure variable that captures the value of `capturedvar`. */
418- predicate captures ( SsaVariable capturedvar ) { captures ( this , capturedvar ) }
419-
420- /**
421- * DEPRECATED: Use `SsaParameterInit::getParameter()` instead.
422- *
423- * Holds if the SSA variable is a parameter defined by its initial value in the callable.
424- */
425- deprecated predicate isParameterDefinition ( Parameter p ) {
426- this .getSourceVariable ( ) = TLocalVar ( p .getCallable ( ) , p ) and
427- p .getCallable ( ) .getBody ( ) .getControlFlowNode ( ) = this .getCfgNode ( )
428- }
429- }
430-
431- /**
432- * DEPRECATED: Use `SsaPhiDefinition` instead.
433- *
434- * An SSA phi node.
435- */
436- deprecated class SsaPhiNode extends SsaVariable instanceof PhiNode {
437- override string toString ( ) { result = "SSA phi(" + this .getSourceVariable ( ) + ")" }
438-
439- /**
440- * DEPRECATED: Use `getAnInput()` instead.
441- *
442- * Gets an input to the phi node defining the SSA variable.
443- */
444- deprecated SsaVariable getAPhiInput ( ) { this .hasInputFromBlock ( result , _) }
445-
446- /** Gets an input to the phi node defining the SSA variable. */
447- SsaVariable getAnInput ( ) { this .hasInputFromBlock ( result , _) }
448-
449- /** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
450- predicate hasInputFromBlock ( SsaVariable inp , BasicBlock bb ) {
451- phiHasInputFromBlock ( this , inp , bb )
452- }
453- }
454-
455215private class RefTypeCastingExpr extends CastingExpr {
456216 RefTypeCastingExpr ( ) {
457217 this .getType ( ) instanceof RefType and
0 commit comments