@@ -2769,6 +2769,43 @@ class TranslatedTemporaryObjectExpr extends TranslatedNonConstantExpr,
2769
2769
final override Instruction getResult ( ) { result = this .getTargetAddress ( ) }
2770
2770
}
2771
2771
2772
+ class TranslatedReuseExpr extends TranslatedNonConstantExpr {
2773
+ override ReuseExpr expr ;
2774
+
2775
+ override Instruction getFirstInstruction ( EdgeKind kind ) {
2776
+ result = this .getInstruction ( OnlyInstructionTag ( ) ) and
2777
+ kind instanceof GotoEdge
2778
+ }
2779
+
2780
+ override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
2781
+ opcode instanceof Opcode:: CopyValue and
2782
+ tag instanceof OnlyInstructionTag and
2783
+ resultType = this .getResultType ( )
2784
+ }
2785
+
2786
+ override Instruction getResult ( ) { result = this .getInstruction ( OnlyInstructionTag ( ) ) }
2787
+
2788
+ override Instruction getInstructionSuccessorInternal ( InstructionTag tag , EdgeKind kind ) {
2789
+ tag = OnlyInstructionTag ( ) and
2790
+ kind instanceof GotoEdge and
2791
+ result = this .getParent ( ) .getChildSuccessor ( this , kind )
2792
+ }
2793
+
2794
+ override TranslatedElement getChildInternal ( int id ) { none ( ) }
2795
+
2796
+ override Instruction getALastInstructionInternal ( ) {
2797
+ result = this .getInstruction ( OnlyInstructionTag ( ) )
2798
+ }
2799
+
2800
+ override Instruction getInstructionRegisterOperand ( InstructionTag tag , OperandTag operandTag ) {
2801
+ tag = OnlyInstructionTag ( ) and
2802
+ operandTag instanceof UnaryOperandTag and
2803
+ if getTranslatedExpr ( expr .getReusedExpr ( ) ) instanceof TranslatedLoad
2804
+ then result = getTranslatedExpr ( expr .getReusedExpr ( ) ) .( TranslatedLoad ) .getOperand ( ) .getResult ( )
2805
+ else result = getTranslatedExpr ( expr .getReusedExpr ( ) ) .getResult ( )
2806
+ }
2807
+ }
2808
+
2772
2809
/**
2773
2810
* IR translation of a `throw` expression.
2774
2811
*/
0 commit comments