@@ -1853,19 +1853,29 @@ private Opcode spaceShipOpcode(SpaceshipExpr expr) {
18531853/**
18541854 * IR translation of a simple binary operation.
18551855 */
1856- class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
1856+ class TranslatedBinaryOperation extends TranslatedNonConstantExpr {
18571857 TranslatedBinaryOperation ( ) {
18581858 expr instanceof BinaryArithmeticOperation or
18591859 expr instanceof BinaryBitwiseOperation or
18601860 expr instanceof ComparisonOperation
18611861 }
18621862
1863+ final override Instruction getResult ( ) {
1864+ result = this .getInstruction ( BinaryOperationOperationTag ( ) )
1865+ }
1866+
1867+ final override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
1868+ opcode = this .getOpcode ( ) and
1869+ tag = BinaryOperationOperationTag ( ) and
1870+ resultType = this .getResultType ( )
1871+ }
1872+
18631873 override Instruction getFirstInstruction ( EdgeKind kind ) {
18641874 result = this .getLeftOperand ( ) .getFirstInstruction ( kind )
18651875 }
18661876
18671877 override Instruction getALastInstructionInternal ( ) {
1868- result = this .getInstruction ( OnlyInstructionTag ( ) )
1878+ result = this .getInstruction ( BinaryOperationOperationTag ( ) )
18691879 }
18701880
18711881 final override TranslatedElement getChildInternal ( int id ) {
@@ -1875,7 +1885,7 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
18751885 }
18761886
18771887 final override Instruction getInstructionRegisterOperand ( InstructionTag tag , OperandTag operandTag ) {
1878- tag = OnlyInstructionTag ( ) and
1888+ tag = BinaryOperationOperationTag ( ) and
18791889 if this .swapOperandsOnOp ( )
18801890 then (
18811891 operandTag instanceof RightOperandTag and
@@ -1893,7 +1903,7 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
18931903 }
18941904
18951905 override Instruction getInstructionSuccessorInternal ( InstructionTag tag , EdgeKind kind ) {
1896- tag = OnlyInstructionTag ( ) and
1906+ tag = BinaryOperationOperationTag ( ) and
18971907 result = this .getParent ( ) .getChildSuccessor ( this , kind )
18981908 }
18991909
@@ -1903,10 +1913,10 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
19031913 or
19041914 kind instanceof GotoEdge and
19051915 child = this .getRightOperand ( ) and
1906- result = this .getInstruction ( OnlyInstructionTag ( ) )
1916+ result = this .getInstruction ( BinaryOperationOperationTag ( ) )
19071917 }
19081918
1909- override Opcode getOpcode ( ) {
1919+ Opcode getOpcode ( ) {
19101920 result = binaryArithmeticOpcode ( expr ) or
19111921 result = binaryBitwiseOpcode ( expr ) or
19121922 result = comparisonOpcode ( expr ) or
@@ -1920,7 +1930,7 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
19201930 }
19211931
19221932 override int getInstructionElementSize ( InstructionTag tag ) {
1923- tag = OnlyInstructionTag ( ) and
1933+ tag = BinaryOperationOperationTag ( ) and
19241934 exists ( Opcode opcode |
19251935 opcode = this .getOpcode ( ) and
19261936 (
0 commit comments