@@ -648,19 +648,7 @@ abstract class TranslatedCrementOperation extends TranslatedNonConstantExpr {
648
648
class TranslatedPrefixCrementOperation extends TranslatedCrementOperation {
649
649
override PrefixCrementOperation expr ;
650
650
651
- override Instruction getResult ( ) {
652
- if expr .isPRValueCategory ( )
653
- then
654
- // If this is C, then the result of a prefix crement is a prvalue for the
655
- // new value assigned to the operand. If this is C++, then the result is
656
- // an lvalue, but that lvalue is being loaded as part of this expression.
657
- // EDG doesn't mark this as a load.
658
- result = this .getInstruction ( CrementOpTag ( ) )
659
- else
660
- // This is C++, where the result is an lvalue for the operand, and that
661
- // lvalue is not being loaded as part of this expression.
662
- result = this .getUnloadedOperand ( ) .getResult ( )
663
- }
651
+ override Instruction getResult ( ) { result = this .getUnloadedOperand ( ) .getResult ( ) }
664
652
}
665
653
666
654
class TranslatedPostfixCrementOperation extends TranslatedCrementOperation {
@@ -1503,19 +1491,7 @@ class TranslatedAssignExpr extends TranslatedNonConstantExpr {
1503
1491
result = this .getRightOperand ( ) .getFirstInstruction ( )
1504
1492
}
1505
1493
1506
- final override Instruction getResult ( ) {
1507
- if expr .isPRValueCategory ( )
1508
- then
1509
- // If this is C, then the result of an assignment is a prvalue for the new
1510
- // value assigned to the left operand. If this is C++, then the result is
1511
- // an lvalue, but that lvalue is being loaded as part of this expression.
1512
- // EDG doesn't mark this as a load.
1513
- result = this .getRightOperand ( ) .getResult ( )
1514
- else
1515
- // This is C++, where the result is an lvalue for the left operand,
1516
- // and that lvalue is not being loaded as part of this expression.
1517
- result = this .getLeftOperand ( ) .getResult ( )
1518
- }
1494
+ final override Instruction getResult ( ) { result = this .getLeftOperand ( ) .getResult ( ) }
1519
1495
1520
1496
final TranslatedExpr getLeftOperand ( ) {
1521
1497
result = getTranslatedExpr ( expr .getLValue ( ) .getFullyConverted ( ) )
@@ -1641,19 +1617,7 @@ class TranslatedAssignOperation extends TranslatedNonConstantExpr {
1641
1617
result = this .getRightOperand ( ) .getFirstInstruction ( )
1642
1618
}
1643
1619
1644
- final override Instruction getResult ( ) {
1645
- if expr .isPRValueCategory ( )
1646
- then
1647
- // If this is C, then the result of an assignment is a prvalue for the new
1648
- // value assigned to the left operand. If this is C++, then the result is
1649
- // an lvalue, but that lvalue is being loaded as part of this expression.
1650
- // EDG doesn't mark this as a load.
1651
- result = this .getStoredValue ( )
1652
- else
1653
- // This is C++, where the result is an lvalue for the left operand,
1654
- // and that lvalue is not being loaded as part of this expression.
1655
- result = this .getUnloadedLeftOperand ( ) .getResult ( )
1656
- }
1620
+ final override Instruction getResult ( ) { result = this .getUnloadedLeftOperand ( ) .getResult ( ) }
1657
1621
1658
1622
final TranslatedExpr getUnloadedLeftOperand ( ) {
1659
1623
result = this .getLoadedLeftOperand ( ) .getOperand ( )
@@ -3237,11 +3201,9 @@ predicate exprNeedsCopyIfNotLoaded(Expr expr) {
3237
3201
(
3238
3202
expr instanceof AssignExpr
3239
3203
or
3240
- expr instanceof AssignOperation and
3241
- not expr .isPRValueCategory ( ) // is C++
3204
+ expr instanceof AssignOperation
3242
3205
or
3243
- expr instanceof PrefixCrementOperation and
3244
- not expr .isPRValueCategory ( ) // is C++
3206
+ expr instanceof PrefixCrementOperation
3245
3207
or
3246
3208
// Because the load is on the `e` in `e++`.
3247
3209
expr instanceof PostfixCrementOperation
0 commit comments