@@ -103,7 +103,7 @@ module InstructionSanity {
103103 query predicate missingOperandType ( Operand operand , string message ) {
104104 exists ( Function func |
105105 not exists ( operand .getType ( ) ) and
106- func = operand .getUseInstruction ( ) .getEnclosingFunction ( ) and
106+ func = operand .getUse ( ) .getEnclosingFunction ( ) and
107107 message = "Operand missing type in function '" + getIdentityString ( func ) + "'."
108108 )
109109 }
@@ -158,8 +158,8 @@ module InstructionSanity {
158158 * a different function.
159159 */
160160 query predicate operandAcrossFunctions ( Operand operand , Instruction instr , Instruction defInstr ) {
161- operand .getUseInstruction ( ) = instr and
162- operand .getDefinitionInstruction ( ) = defInstr and
161+ operand .getUse ( ) = instr and
162+ operand .getAnyDef ( ) = defInstr and
163163 instr .getEnclosingIRFunction ( ) != defInstr .getEnclosingIRFunction ( )
164164 }
165165
@@ -480,17 +480,18 @@ class Instruction extends Construction::TInstruction {
480480 }
481481
482482 /**
483- * Gets all direct uses of the result of this instruction.
483+ * Gets all direct uses of the result of this instruction. The result can be
484+ * an `Operand` for which `isDefinitionInexact` holds.
484485 */
485486 final Operand getAUse ( ) {
486- result .getDefinitionInstruction ( ) = this
487+ result .getAnyDef ( ) = this
487488 }
488489
489490 /**
490491 * Gets all of this instruction's operands.
491492 */
492493 final Operand getAnOperand ( ) {
493- result .getUseInstruction ( ) = this
494+ result .getUse ( ) = this
494495 }
495496
496497 /**
@@ -509,13 +510,22 @@ class Instruction extends Construction::TInstruction {
509510 }
510511
511512 /**
512- * Returns the operand that holds the memory address to which the instruction stores its
513+ * Gets the operand that holds the memory address to which this instruction stores its
513514 * result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
514515 * is `r1`.
515516 */
516517 final AddressOperand getResultAddressOperand ( ) {
517518 getResultMemoryAccess ( ) .usesAddressOperand ( ) and
518- result .getUseInstruction ( ) = this
519+ result .getUse ( ) = this
520+ }
521+
522+ /**
523+ * Gets the instruction that holds the exact memory address to which this instruction stores its
524+ * result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
525+ * is the instruction that defines `r1`.
526+ */
527+ final Instruction getResultAddress ( ) {
528+ result = getResultAddressOperand ( ) .getDef ( )
519529 }
520530
521531 /**
@@ -698,7 +708,7 @@ class FieldAddressInstruction extends FieldInstruction {
698708 }
699709
700710 final Instruction getObjectAddress ( ) {
701- result = getObjectAddressOperand ( ) .getDefinitionInstruction ( )
711+ result = getObjectAddressOperand ( ) .getDef ( )
702712 }
703713}
704714
@@ -763,7 +773,7 @@ class ReturnValueInstruction extends ReturnInstruction {
763773 }
764774
765775 final Instruction getReturnValue ( ) {
766- result = getReturnValueOperand ( ) .getDefinitionInstruction ( )
776+ result = getReturnValueOperand ( ) .getDef ( )
767777 }
768778}
769779
@@ -777,7 +787,7 @@ class CopyInstruction extends Instruction {
777787 }
778788
779789 final Instruction getSourceValue ( ) {
780- result = getSourceValueOperand ( ) .getDefinitionInstruction ( )
790+ result = getSourceValueOperand ( ) .getDef ( )
781791 }
782792}
783793
@@ -801,7 +811,7 @@ class LoadInstruction extends CopyInstruction {
801811 }
802812
803813 final Instruction getSourceAddress ( ) {
804- result = getSourceAddressOperand ( ) .getDefinitionInstruction ( )
814+ result = getSourceAddressOperand ( ) .getDef ( )
805815 }
806816
807817 override final LoadOperand getSourceValueOperand ( ) {
@@ -823,7 +833,7 @@ class StoreInstruction extends CopyInstruction {
823833 }
824834
825835 final Instruction getDestinationAddress ( ) {
826- result = getDestinationAddressOperand ( ) .getDefinitionInstruction ( )
836+ result = getDestinationAddressOperand ( ) .getDef ( )
827837 }
828838
829839 override final StoreValueOperand getSourceValueOperand ( ) {
@@ -841,7 +851,7 @@ class ConditionalBranchInstruction extends Instruction {
841851 }
842852
843853 final Instruction getCondition ( ) {
844- result = getConditionOperand ( ) .getDefinitionInstruction ( )
854+ result = getConditionOperand ( ) .getDef ( )
845855 }
846856
847857 final Instruction getTrueSuccessor ( ) {
@@ -907,11 +917,11 @@ class BinaryInstruction extends Instruction {
907917 }
908918
909919 final Instruction getLeft ( ) {
910- result = getLeftOperand ( ) .getDefinitionInstruction ( )
920+ result = getLeftOperand ( ) .getDef ( )
911921 }
912922
913923 final Instruction getRight ( ) {
914- result = getRightOperand ( ) .getDefinitionInstruction ( )
924+ result = getRightOperand ( ) .getDef ( )
915925 }
916926
917927 /**
@@ -1061,7 +1071,7 @@ class UnaryInstruction extends Instruction {
10611071 }
10621072
10631073 final Instruction getUnary ( ) {
1064- result = getUnaryOperand ( ) .getDefinitionInstruction ( )
1074+ result = getUnaryOperand ( ) .getDef ( )
10651075 }
10661076}
10671077
@@ -1291,7 +1301,7 @@ class SwitchInstruction extends Instruction {
12911301 }
12921302
12931303 final Instruction getExpression ( ) {
1294- result = getExpressionOperand ( ) .getDefinitionInstruction ( )
1304+ result = getExpressionOperand ( ) .getDef ( )
12951305 }
12961306
12971307 final Instruction getACaseSuccessor ( ) {
@@ -1326,7 +1336,7 @@ class CallInstruction extends Instruction {
13261336 * function pointer.
13271337 */
13281338 final Instruction getCallTarget ( ) {
1329- result = getCallTargetOperand ( ) .getDefinitionInstruction ( )
1339+ result = getCallTargetOperand ( ) .getDef ( )
13301340 }
13311341
13321342 /**
@@ -1347,7 +1357,7 @@ class CallInstruction extends Instruction {
13471357 * Gets all of the arguments of the call, including the `this` pointer, if any.
13481358 */
13491359 final Instruction getAnArgument ( ) {
1350- result = getAnArgumentOperand ( ) .getDefinitionInstruction ( )
1360+ result = getAnArgumentOperand ( ) .getDef ( )
13511361 }
13521362
13531363 /**
@@ -1361,7 +1371,7 @@ class CallInstruction extends Instruction {
13611371 * Gets the `this` pointer argument of the call, if any.
13621372 */
13631373 final Instruction getThisArgument ( ) {
1364- result = getThisArgumentOperand ( ) .getDefinitionInstruction ( )
1374+ result = getThisArgumentOperand ( ) .getDef ( )
13651375 }
13661376
13671377 /**
@@ -1376,7 +1386,7 @@ class CallInstruction extends Instruction {
13761386 * Gets the argument at the specified index.
13771387 */
13781388 final Instruction getPositionalArgument ( int index ) {
1379- result = getPositionalArgumentOperand ( index ) .getDefinitionInstruction ( )
1389+ result = getPositionalArgumentOperand ( index ) .getDef ( )
13801390 }
13811391}
13821392
@@ -1532,7 +1542,7 @@ class ThrowValueInstruction extends ThrowInstruction {
15321542 * Gets the address of the exception thrown by this instruction.
15331543 */
15341544 final Instruction getExceptionAddress ( ) {
1535- result = getExceptionAddressOperand ( ) .getDefinitionInstruction ( )
1545+ result = getExceptionAddressOperand ( ) .getDef ( )
15361546 }
15371547
15381548 /**
@@ -1546,7 +1556,7 @@ class ThrowValueInstruction extends ThrowInstruction {
15461556 * Gets the exception thrown by this instruction.
15471557 */
15481558 final Instruction getException ( ) {
1549- result = getExceptionOperand ( ) .getDefinitionInstruction ( )
1559+ result = getExceptionOperand ( ) .getDef ( )
15501560 }
15511561}
15521562
@@ -1676,7 +1686,7 @@ class PhiInstruction extends Instruction {
16761686 */
16771687 pragma [ noinline]
16781688 final Instruction getAnInput ( ) {
1679- result = this .getAnInputOperand ( ) .getDefinitionInstruction ( )
1689+ result = this .getAnInputOperand ( ) .getDef ( )
16801690 }
16811691}
16821692
@@ -1744,7 +1754,7 @@ class ChiInstruction extends Instruction {
17441754 * memory write.
17451755 */
17461756 final Instruction getTotal ( ) {
1747- result = getTotalOperand ( ) .getDefinitionInstruction ( )
1757+ result = getTotalOperand ( ) .getDef ( )
17481758 }
17491759
17501760 /**
@@ -1758,7 +1768,7 @@ class ChiInstruction extends Instruction {
17581768 * Gets the operand that represents the new value written by the memory write.
17591769 */
17601770 final Instruction getPartial ( ) {
1761- result = getPartialOperand ( ) .getDefinitionInstruction ( )
1771+ result = getPartialOperand ( ) .getDef ( )
17621772 }
17631773}
17641774
0 commit comments