@@ -218,18 +218,18 @@ private predicate hasVariableReadWithCapturedWrite(
218218
219219pragma [ noinline]
220220deprecated private predicate adjacentDefReadExt (
221- DefinitionExt def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2 ,
221+ Definition def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2 ,
222222 SsaInput:: SourceVariable v
223223) {
224224 Impl:: adjacentDefReadExt ( def , _, bb1 , i1 , bb2 , i2 ) and
225225 v = def .getSourceVariable ( )
226226}
227227
228228deprecated private predicate adjacentDefReachesReadExt (
229- DefinitionExt def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2
229+ Definition def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2
230230) {
231231 exists ( SsaInput:: SourceVariable v | adjacentDefReadExt ( def , bb1 , i1 , bb2 , i2 , v ) |
232- def .definesAt ( v , bb1 , i1 , _ )
232+ def .definesAt ( v , bb1 , i1 )
233233 or
234234 SsaInput:: variableRead ( bb1 , i1 , v , true )
235235 )
@@ -242,7 +242,7 @@ deprecated private predicate adjacentDefReachesReadExt(
242242}
243243
244244deprecated private predicate adjacentDefReachesUncertainReadExt (
245- DefinitionExt def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2
245+ Definition def , SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2
246246) {
247247 adjacentDefReachesReadExt ( def , bb1 , i1 , bb2 , i2 ) and
248248 SsaInput:: variableRead ( bb2 , i2 , _, false )
@@ -251,7 +251,7 @@ deprecated private predicate adjacentDefReachesUncertainReadExt(
251251/** Same as `lastRefRedef`, but skips uncertain reads. */
252252pragma [ nomagic]
253253deprecated private predicate lastRefSkipUncertainReadsExt (
254- DefinitionExt def , SsaInput:: BasicBlock bb , int i
254+ Definition def , SsaInput:: BasicBlock bb , int i
255255) {
256256 Impl:: lastRef ( def , bb , i ) and
257257 not SsaInput:: variableRead ( bb , i , def .getSourceVariable ( ) , false )
@@ -413,33 +413,6 @@ private module Cached {
413413
414414import Cached
415415
416- /**
417- * An extended static single assignment (SSA) definition.
418- *
419- * This is either a normal SSA definition (`Definition`) or a
420- * phi-read node (`PhiReadNode`).
421- *
422- * Only intended for internal use.
423- */
424- class DefinitionExt extends Impl:: DefinitionExt {
425- VariableReadAccessCfgNode getARead ( ) { result = getARead ( this ) }
426-
427- override string toString ( ) { result = this .( Ssa:: Definition ) .toString ( ) }
428-
429- override Location getLocation ( ) { result = this .( Ssa:: Definition ) .getLocation ( ) }
430- }
431-
432- /**
433- * A phi-read node.
434- *
435- * Only intended for internal use.
436- */
437- class PhiReadNode extends DefinitionExt , Impl:: PhiReadNode {
438- override string toString ( ) { result = "SSA phi read(" + this .getSourceVariable ( ) + ")" }
439-
440- override Location getLocation ( ) { result = Impl:: PhiReadNode .super .getLocation ( ) }
441- }
442-
443416class NormalParameter extends Parameter {
444417 NormalParameter ( ) {
445418 this instanceof SimpleParameter or
@@ -453,10 +426,10 @@ class NormalParameter extends Parameter {
453426
454427/** Gets the SSA definition node corresponding to parameter `p`. */
455428pragma [ nomagic]
456- DefinitionExt getParameterDef ( NamedParameter p ) {
429+ Definition getParameterDef ( NamedParameter p ) {
457430 exists ( Cfg:: BasicBlock bb , int i |
458431 bb .getNode ( i ) .getAstNode ( ) = p .getDefiningAccess ( ) and
459- result .definesAt ( _, bb , i , _ )
432+ result .definesAt ( _, bb , i )
460433 )
461434}
462435
@@ -515,21 +488,24 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
515488 predicate ssaDefInitializesParam ( WriteDefinition def , Parameter p ) { p .isInitializedBy ( def ) }
516489
517490 class Guard extends Cfg:: CfgNodes:: AstCfgNode {
518- predicate hasCfgNode ( SsaInput:: BasicBlock bb , int i ) { this = bb .getNode ( i ) }
491+ /**
492+ * Holds if the control flow branching from `bb1` is dependent on this guard,
493+ * and that the edge from `bb1` to `bb2` corresponds to the evaluation of this
494+ * guard to `branch`.
495+ */
496+ predicate controlsBranchEdge ( SsaInput:: BasicBlock bb1 , SsaInput:: BasicBlock bb2 , boolean branch ) {
497+ exists ( Cfg:: SuccessorTypes:: ConditionalSuccessor s |
498+ this .getBasicBlock ( ) = bb1 and
499+ bb2 = bb1 .getASuccessor ( s ) and
500+ s .getValue ( ) = branch
501+ )
502+ }
519503 }
520504
521505 /** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */
522506 predicate guardControlsBlock ( Guard guard , SsaInput:: BasicBlock bb , boolean branch ) {
523507 Guards:: guardControlsBlock ( guard , bb , branch )
524508 }
525-
526- /** Gets an immediate conditional successor of basic block `bb`, if any. */
527- SsaInput:: BasicBlock getAConditionalBasicBlockSuccessor ( SsaInput:: BasicBlock bb , boolean branch ) {
528- exists ( Cfg:: SuccessorTypes:: ConditionalSuccessor s |
529- result = bb .getASuccessor ( s ) and
530- s .getValue ( ) = branch
531- )
532- }
533509}
534510
535511private module DataFlowIntegrationImpl = Impl:: DataFlowIntegration< DataFlowIntegrationInput > ;
0 commit comments