@@ -665,8 +665,12 @@ class FieldAddressInstruction extends FieldInstruction {
665665 getOpcode ( ) instanceof Opcode:: FieldAddress
666666 }
667667
668+ final UnaryOperand getObjectAddressOperand ( ) {
669+ result = getAnOperand ( )
670+ }
671+
668672 final Instruction getObjectAddress ( ) {
669- result = getAnOperand ( ) . ( UnaryOperand ) .getDefinitionInstruction ( )
673+ result = getObjectAddressOperand ( ) .getDefinitionInstruction ( )
670674 }
671675}
672676
@@ -710,8 +714,12 @@ class ReturnValueInstruction extends ReturnInstruction {
710714 getOpcode ( ) instanceof Opcode:: ReturnValue
711715 }
712716
717+ final ReturnValueOperand getReturnValueOperand ( ) {
718+ result = getAnOperand ( )
719+ }
720+
713721 final Instruction getReturnValue ( ) {
714- result = getAnOperand ( ) . ( ReturnValueOperand ) .getDefinitionInstruction ( )
722+ result = getReturnValueOperand ( ) .getDefinitionInstruction ( )
715723 }
716724}
717725
@@ -720,8 +728,12 @@ class CopyInstruction extends Instruction {
720728 getOpcode ( ) instanceof CopyOpcode
721729 }
722730
731+ final CopySourceOperand getSourceValueOperand ( ) {
732+ result = getAnOperand ( )
733+ }
734+
723735 final Instruction getSourceValue ( ) {
724- result = getAnOperand ( ) . ( CopySourceOperand ) .getDefinitionInstruction ( )
736+ result = getSourceValueOperand ( ) .getDefinitionInstruction ( )
725737 }
726738}
727739
@@ -736,8 +748,12 @@ class LoadInstruction extends CopyInstruction {
736748 getOpcode ( ) instanceof Opcode:: Load
737749 }
738750
751+ final AddressOperand getSourceAddressOperand ( ) {
752+ result = getAnOperand ( )
753+ }
754+
739755 final Instruction getSourceAddress ( ) {
740- result = getAnOperand ( ) . ( AddressOperand ) .getDefinitionInstruction ( )
756+ result = getSourceAddressOperand ( ) .getDefinitionInstruction ( )
741757 }
742758}
743759
@@ -750,8 +766,12 @@ class StoreInstruction extends CopyInstruction {
750766 result instanceof IndirectMemoryAccess
751767 }
752768
769+ final AddressOperand getDestinationAddressOperand ( ) {
770+ result = getAnOperand ( )
771+ }
772+
753773 final Instruction getDestinationAddress ( ) {
754- result = getAnOperand ( ) . ( AddressOperand ) .getDefinitionInstruction ( )
774+ result = getDestinationAddressOperand ( ) .getDefinitionInstruction ( )
755775 }
756776}
757777
@@ -760,8 +780,12 @@ class ConditionalBranchInstruction extends Instruction {
760780 getOpcode ( ) instanceof Opcode:: ConditionalBranch
761781 }
762782
783+ final ConditionOperand getConditionOperand ( ) {
784+ result = getAnOperand ( )
785+ }
786+
763787 final Instruction getCondition ( ) {
764- result = getAnOperand ( ) . ( ConditionOperand ) .getDefinitionInstruction ( )
788+ result = getConditionOperand ( ) .getDefinitionInstruction ( )
765789 }
766790
767791 final Instruction getTrueSuccessor ( ) {
@@ -818,21 +842,29 @@ class BinaryInstruction extends Instruction {
818842 getOpcode ( ) instanceof BinaryOpcode
819843 }
820844
845+ final LeftOperand getLeftOperand ( ) {
846+ result = getAnOperand ( )
847+ }
848+
849+ final RightOperand getRightOperand ( ) {
850+ result = getAnOperand ( )
851+ }
852+
821853 final Instruction getLeft ( ) {
822- result = getAnOperand ( ) . ( LeftOperand ) .getDefinitionInstruction ( )
854+ result = getLeftOperand ( ) .getDefinitionInstruction ( )
823855 }
824856
825857 final Instruction getRight ( ) {
826- result = getAnOperand ( ) . ( RightOperand ) .getDefinitionInstruction ( )
858+ result = getRightOperand ( ) .getDefinitionInstruction ( )
827859 }
828860
829861 /**
830862 * Holds if this instruction's operands are `op1` and `op2`, in either order.
831863 */
832864 final predicate hasOperands ( Operand op1 , Operand op2 ) {
833- op1 = getAnOperand ( ) . ( LeftOperand ) and op2 = getAnOperand ( ) . ( RightOperand )
865+ op1 = getLeftOperand ( ) and op2 = getRightOperand ( )
834866 or
835- op1 = getAnOperand ( ) . ( RightOperand ) and op2 = getAnOperand ( ) . ( LeftOperand )
867+ op1 = getRightOperand ( ) and op2 = getLeftOperand ( )
836868 }
837869}
838870
@@ -948,8 +980,12 @@ class UnaryInstruction extends Instruction {
948980 getOpcode ( ) instanceof UnaryOpcode
949981 }
950982
983+ final UnaryOperand getUnaryOperand ( ) {
984+ result = getAnOperand ( )
985+ }
986+
951987 final Instruction getUnary ( ) {
952- result = getAnOperand ( ) . ( UnaryOperand ) .getDefinitionInstruction ( )
988+ result = getUnaryOperand ( ) .getDefinitionInstruction ( )
953989 }
954990}
955991
@@ -1174,8 +1210,12 @@ class SwitchInstruction extends Instruction {
11741210 getOpcode ( ) instanceof Opcode:: Switch
11751211 }
11761212
1213+ final ConditionOperand getExpressionOperand ( ) {
1214+ result = getAnOperand ( )
1215+ }
1216+
11771217 final Instruction getExpression ( ) {
1178- result = getAnOperand ( ) . ( ConditionOperand ) .getDefinitionInstruction ( )
1218+ result = getExpressionOperand ( ) .getDefinitionInstruction ( )
11791219 }
11801220
11811221 final Instruction getACaseSuccessor ( ) {
@@ -1197,38 +1237,63 @@ class CallInstruction extends Instruction {
11971237 getOpcode ( ) instanceof Opcode:: Call
11981238 }
11991239
1240+ /**
1241+ * Gets the operand the specifies the target function of the call.
1242+ */
1243+ final CallTargetOperand getCallTargetOperand ( ) {
1244+ result = getAnOperand ( )
1245+ }
1246+
12001247 /**
12011248 * Gets the `Instruction` that computes the target function of the call. This is usually a
12021249 * `FunctionAddress` instruction, but can also be an arbitrary instruction that produces a
12031250 * function pointer.
12041251 */
12051252 final Instruction getCallTarget ( ) {
1206- result = getAnOperand ( ) .( CallTargetOperand ) .getDefinitionInstruction ( )
1253+ result = getCallTargetOperand ( ) .getDefinitionInstruction ( )
1254+ }
1255+
1256+ /**
1257+ * Gets all of the argument operands of the call, including the `this` pointer, if any.
1258+ */
1259+ final ArgumentOperand getAnArgumentOperand ( ) {
1260+ result = getAnOperand ( )
12071261 }
12081262
12091263 /**
12101264 * Gets all of the arguments of the call, including the `this` pointer, if any.
12111265 */
12121266 final Instruction getAnArgument ( ) {
1213- result = getAnOperand ( ) .( ArgumentOperand ) .getDefinitionInstruction ( )
1267+ result = getAnArgumentOperand ( ) .getDefinitionInstruction ( )
1268+ }
1269+
1270+ /**
1271+ * Gets the `this` pointer argument operand of the call, if any.
1272+ */
1273+ final ThisArgumentOperand getThisArgumentOperand ( ) {
1274+ result = getAnOperand ( )
12141275 }
12151276
12161277 /**
12171278 * Gets the `this` pointer argument of the call, if any.
12181279 */
12191280 final Instruction getThisArgument ( ) {
1220- result = getAnOperand ( ) .( ThisArgumentOperand ) .getDefinitionInstruction ( )
1281+ result = getThisArgumentOperand ( ) .getDefinitionInstruction ( )
1282+ }
1283+
1284+ /**
1285+ * Gets the argument operand at the specified index.
1286+ */
1287+ final PositionalArgumentOperand getPositionalArgumentOperand ( int index ) {
1288+ result = getAnOperand ( ) and
1289+ result .getIndex ( ) = index
12211290 }
12221291
12231292 /**
12241293 * Gets the argument at the specified index.
12251294 */
12261295 final Instruction getPositionalArgument ( int index ) {
1227- exists ( PositionalArgumentOperand operand |
1228- operand = getAnOperand ( ) and
1229- operand .getIndex ( ) = index and
1230- result = operand .getDefinitionInstruction ( )
1231- )
1296+ result = getPositionalArgumentOperand ( index ) .getDefinitionInstruction ( )
12321297 }
12331298}
12341299
@@ -1360,18 +1425,32 @@ class ThrowValueInstruction extends ThrowInstruction {
13601425 getOpcode ( ) instanceof Opcode:: ThrowValue
13611426 }
13621427
1428+ /**
1429+ * Gets the address operand of the exception thrown by this instruction.
1430+ */
1431+ final AddressOperand getExceptionAddressOperand ( ) {
1432+ result = getAnOperand ( )
1433+ }
1434+
13631435 /**
13641436 * Gets the address of the exception thrown by this instruction.
13651437 */
13661438 final Instruction getExceptionAddress ( ) {
1367- result = getAnOperand ( ) .( AddressOperand ) .getDefinitionInstruction ( )
1439+ result = getExceptionAddressOperand ( ) .getDefinitionInstruction ( )
1440+ }
1441+
1442+ /**
1443+ * Gets the operand for the exception thrown by this instruction.
1444+ */
1445+ final ExceptionOperand getExceptionOperand ( ) {
1446+ result = getAnOperand ( )
13681447 }
13691448
13701449 /**
13711450 * Gets the exception thrown by this instruction.
13721451 */
13731452 final Instruction getException ( ) {
1374- result = getAnOperand ( ) . ( ExceptionOperand ) .getDefinitionInstruction ( )
1453+ result = getExceptionOperand ( ) .getDefinitionInstruction ( )
13751454 }
13761455}
13771456
@@ -1549,19 +1628,34 @@ class ChiInstruction extends Instruction {
15491628 result instanceof ChiTotalMemoryAccess
15501629 }
15511630
1631+ /**
1632+ * Gets the operand that represents the previous state of all memory that might be aliased by the
1633+ * memory write.
1634+ */
1635+ final ChiTotalOperand getTotalOperand ( ) {
1636+ result = getAnOperand ( )
1637+ }
1638+
15521639 /**
15531640 * Gets the operand that represents the previous state of all memory that might be aliased by the
15541641 * memory write.
15551642 */
15561643 final Instruction getTotal ( ) {
1557- result = getAnOperand ( ) .( ChiTotalOperand ) .getDefinitionInstruction ( )
1644+ result = getTotalOperand ( ) .getDefinitionInstruction ( )
1645+ }
1646+
1647+ /**
1648+ * Gets the operand that represents the new value written by the memory write.
1649+ */
1650+ final ChiPartialOperand getPartialOperand ( ) {
1651+ result = getAnOperand ( )
15581652 }
15591653
15601654 /**
15611655 * Gets the operand that represents the new value written by the memory write.
15621656 */
15631657 final Instruction getPartial ( ) {
1564- result = getAnOperand ( ) . ( ChiPartialOperand ) .getDefinitionInstruction ( )
1658+ result = getPartialOperand ( ) .getDefinitionInstruction ( )
15651659 }
15661660}
15671661
0 commit comments