@@ -276,7 +276,7 @@ class IRGuardCondition extends Instruction {
276276 this .controlsBlock ( controlled , testIsTrue )
277277 or
278278 exists ( IRGuardCondition ne
279- | this = ne .( LogicalNotInstruction ) .getOperand ( ) and
279+ | this = ne .( LogicalNotInstruction ) .getUnary ( ) and
280280 ne .controls ( controlled , testIsTrue .booleanNot ( ) ) )
281281 }
282282
@@ -359,7 +359,7 @@ private predicate is_condition(Instruction guard) {
359359 branch .getCondition ( ) = guard
360360 )
361361 or
362- exists ( LogicalNotInstruction cond | is_condition ( cond ) and cond .getOperand ( ) = guard )
362+ exists ( LogicalNotInstruction cond | is_condition ( cond ) and cond .getUnary ( ) = guard )
363363}
364364
365365/**
@@ -383,15 +383,15 @@ private predicate compares_eq(Instruction test, Operand left, Operand right, int
383383 or
384384 /* (x is true => (left == right + k)) => (!x is false => (left == right + k)) */
385385 exists ( boolean isFalse | testIsTrue = isFalse .booleanNot ( ) |
386- compares_eq ( test .( LogicalNotInstruction ) .getOperand ( ) , left , right , k , areEqual , isFalse )
386+ compares_eq ( test .( LogicalNotInstruction ) .getUnary ( ) , left , right , k , areEqual , isFalse )
387387 )
388388}
389389
390390/** Rearrange various simple comparisons into `left == right + k` form. */
391391private predicate simple_comparison_eq ( CompareInstruction cmp , Operand left , Operand right , int k , boolean areEqual ) {
392- left = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareEQInstruction and right = cmp .getAnOperand ( ) . ( RightOperand ) and k = 0 and areEqual = true
392+ left = cmp .getLeftOperand ( ) and cmp instanceof CompareEQInstruction and right = cmp .getRightOperand ( ) and k = 0 and areEqual = true
393393 or
394- left = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareNEInstruction and right = cmp .getAnOperand ( ) . ( RightOperand ) and k = 0 and areEqual = false
394+ left = cmp .getLeftOperand ( ) and cmp instanceof CompareNEInstruction and right = cmp .getRightOperand ( ) and k = 0 and areEqual = false
395395}
396396
397397private predicate complex_eq ( CompareInstruction cmp , Operand left , Operand right , int k , boolean areEqual , boolean testIsTrue ) {
@@ -421,7 +421,7 @@ private predicate compares_lt(Instruction test, Operand left, Operand right, int
421421 or
422422 /* (x is true => (left < right + k)) => (!x is false => (left < right + k)) */
423423 exists ( boolean isFalse | testIsTrue = isFalse .booleanNot ( ) |
424- compares_lt ( test .( LogicalNotInstruction ) .getOperand ( ) , left , right , k , isLt , isFalse )
424+ compares_lt ( test .( LogicalNotInstruction ) .getUnary ( ) , left , right , k , isLt , isFalse )
425425 )
426426}
427427
@@ -432,13 +432,13 @@ private predicate compares_ge(Instruction test, Operand left, Operand right, int
432432
433433/** Rearrange various simple comparisons into `left < right + k` form. */
434434private predicate simple_comparison_lt ( CompareInstruction cmp , Operand left , Operand right , int k ) {
435- left = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareLTInstruction and right = cmp .getAnOperand ( ) . ( RightOperand ) and k = 0
435+ left = cmp .getLeftOperand ( ) and cmp instanceof CompareLTInstruction and right = cmp .getRightOperand ( ) and k = 0
436436 or
437- left = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareLEInstruction and right = cmp .getAnOperand ( ) . ( RightOperand ) and k = 1
437+ left = cmp .getLeftOperand ( ) and cmp instanceof CompareLEInstruction and right = cmp .getRightOperand ( ) and k = 1
438438 or
439- right = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareGTInstruction and left = cmp .getAnOperand ( ) . ( RightOperand ) and k = 0
439+ right = cmp .getLeftOperand ( ) and cmp instanceof CompareGTInstruction and left = cmp .getRightOperand ( ) and k = 0
440440 or
441- right = cmp .getAnOperand ( ) . ( LeftOperand ) and cmp instanceof CompareGEInstruction and left = cmp .getAnOperand ( ) . ( RightOperand ) and k = 1
441+ right = cmp .getLeftOperand ( ) and cmp instanceof CompareGEInstruction and left = cmp .getRightOperand ( ) and k = 1
442442}
443443
444444private predicate complex_lt ( CompareInstruction cmp , Operand left , Operand right , int k , boolean isLt , boolean testIsTrue ) {
@@ -452,12 +452,12 @@ private predicate complex_lt(CompareInstruction cmp, Operand left, Operand right
452452 left < (right - x) + c => left < right + (c-x) */
453453private predicate sub_lt ( CompareInstruction cmp , Operand left , Operand right , int k , boolean isLt , boolean testIsTrue ) {
454454 exists ( SubInstruction lhs , int c , int x | compares_lt ( cmp , lhs .getAUse ( ) , right , c , isLt , testIsTrue ) and
455- left = lhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( lhs .getRightOperand ( ) )
455+ left = lhs .getLeftOperand ( ) and x = int_value ( lhs .getRight ( ) )
456456 and k = c + x
457457 )
458458 or
459459 exists ( SubInstruction rhs , int c , int x | compares_lt ( cmp , left , rhs .getAUse ( ) , c , isLt , testIsTrue ) and
460- right = rhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( rhs .getRightOperand ( ) )
460+ right = rhs .getLeftOperand ( ) and x = int_value ( rhs .getRight ( ) )
461461 and k = c - x
462462 )
463463}
@@ -466,17 +466,17 @@ private predicate sub_lt(CompareInstruction cmp, Operand left, Operand right, in
466466 left < (right + x) + c => left < right + (c+x) */
467467private predicate add_lt ( CompareInstruction cmp , Operand left , Operand right , int k , boolean isLt , boolean testIsTrue ) {
468468 exists ( AddInstruction lhs , int c , int x | compares_lt ( cmp , lhs .getAUse ( ) , right , c , isLt , testIsTrue ) and
469- ( left = lhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( lhs .getRightOperand ( ) )
469+ ( left = lhs .getLeftOperand ( ) and x = int_value ( lhs .getRight ( ) )
470470 or
471- left = lhs .getAnOperand ( ) . ( RightOperand ) and x = int_value ( lhs .getLeftOperand ( ) )
471+ left = lhs .getRightOperand ( ) and x = int_value ( lhs .getLeft ( ) )
472472 )
473473 and k = c - x
474474 )
475475 or
476476 exists ( AddInstruction rhs , int c , int x | compares_lt ( cmp , left , rhs .getAUse ( ) , c , isLt , testIsTrue ) and
477- ( right = rhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( rhs .getRightOperand ( ) )
477+ ( right = rhs .getLeftOperand ( ) and x = int_value ( rhs .getRight ( ) )
478478 or
479- right = rhs .getAnOperand ( ) . ( RightOperand ) and x = int_value ( rhs .getLeftOperand ( ) )
479+ right = rhs .getRightOperand ( ) and x = int_value ( rhs .getLeft ( ) )
480480 )
481481 and k = c + x
482482 )
@@ -487,12 +487,12 @@ private predicate add_lt(CompareInstruction cmp, Operand left, Operand right, in
487487 left == (right - x) + c => left == right + (c-x) */
488488private predicate sub_eq ( CompareInstruction cmp , Operand left , Operand right , int k , boolean areEqual , boolean testIsTrue ) {
489489 exists ( SubInstruction lhs , int c , int x | compares_eq ( cmp , lhs .getAUse ( ) , right , c , areEqual , testIsTrue ) and
490- left = lhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( lhs .getRightOperand ( ) )
490+ left = lhs .getLeftOperand ( ) and x = int_value ( lhs .getRight ( ) )
491491 and k = c + x
492492 )
493493 or
494494 exists ( SubInstruction rhs , int c , int x | compares_eq ( cmp , left , rhs .getAUse ( ) , c , areEqual , testIsTrue ) and
495- right = rhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( rhs .getRightOperand ( ) )
495+ right = rhs .getLeftOperand ( ) and x = int_value ( rhs .getRight ( ) )
496496 and k = c - x
497497 )
498498}
@@ -502,17 +502,17 @@ private predicate sub_eq(CompareInstruction cmp, Operand left, Operand right, in
502502 left == (right + x) + c => left == right + (c+x) */
503503private predicate add_eq ( CompareInstruction cmp , Operand left , Operand right , int k , boolean areEqual , boolean testIsTrue ) {
504504 exists ( AddInstruction lhs , int c , int x | compares_eq ( cmp , lhs .getAUse ( ) , right , c , areEqual , testIsTrue ) and
505- ( left = lhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( lhs .getRightOperand ( ) )
505+ ( left = lhs .getLeftOperand ( ) and x = int_value ( lhs .getRight ( ) )
506506 or
507- left = lhs .getAnOperand ( ) . ( RightOperand ) and x = int_value ( lhs .getLeftOperand ( ) )
507+ left = lhs .getRightOperand ( ) and x = int_value ( lhs .getLeft ( ) )
508508 )
509509 and k = c - x
510510 )
511511 or
512512 exists ( AddInstruction rhs , int c , int x | compares_eq ( cmp , left , rhs .getAUse ( ) , c , areEqual , testIsTrue ) and
513- ( right = rhs .getAnOperand ( ) . ( LeftOperand ) and x = int_value ( rhs .getRightOperand ( ) )
513+ ( right = rhs .getLeftOperand ( ) and x = int_value ( rhs .getRight ( ) )
514514 or
515- right = rhs .getAnOperand ( ) . ( RightOperand ) and x = int_value ( rhs .getLeftOperand ( ) )
515+ right = rhs .getRightOperand ( ) and x = int_value ( rhs .getLeft ( ) )
516516 )
517517 and k = c + x
518518 )
0 commit comments