@@ -1262,9 +1262,10 @@ abstract class TranslatedSingleInstructionExpr extends TranslatedNonConstantExpr
1262
1262
1263
1263
class TranslatedUnaryExpr extends TranslatedSingleInstructionExpr {
1264
1264
TranslatedUnaryExpr ( ) {
1265
- expr instanceof NotExpr or
1266
- expr instanceof ComplementExpr or
1267
- expr instanceof UnaryPlusExpr or
1265
+ expr instanceof ComplementExpr
1266
+ or
1267
+ expr instanceof UnaryPlusExpr
1268
+ or
1268
1269
expr instanceof UnaryMinusExpr
1269
1270
}
1270
1271
@@ -1298,8 +1299,6 @@ class TranslatedUnaryExpr extends TranslatedSingleInstructionExpr {
1298
1299
}
1299
1300
1300
1301
final override Opcode getOpcode ( ) {
1301
- expr instanceof NotExpr and result instanceof Opcode:: LogicalNot
1302
- or
1303
1302
expr instanceof ComplementExpr and result instanceof Opcode:: BitComplement
1304
1303
or
1305
1304
expr instanceof UnaryPlusExpr and result instanceof Opcode:: CopyValue
@@ -1312,6 +1311,51 @@ class TranslatedUnaryExpr extends TranslatedSingleInstructionExpr {
1312
1311
}
1313
1312
}
1314
1313
1314
+ class TranslatedNotExpr extends TranslatedNonConstantExpr {
1315
+ override NotExpr expr ;
1316
+
1317
+ final override Instruction getFirstInstruction ( EdgeKind kind ) {
1318
+ result = this .getOperand ( ) .getFirstInstruction ( kind )
1319
+ }
1320
+
1321
+ override Instruction getALastInstructionInternal ( ) {
1322
+ result = this .getInstruction ( OnlyInstructionTag ( ) )
1323
+ }
1324
+
1325
+ final override TranslatedElement getChildInternal ( int id ) {
1326
+ id = 0 and result = this .getOperand ( )
1327
+ }
1328
+
1329
+ override predicate hasInstruction ( Opcode opcode , InstructionTag tag , CppType resultType ) {
1330
+ tag = OnlyInstructionTag ( ) and
1331
+ opcode instanceof Opcode:: LogicalNot and
1332
+ resultType = getBoolType ( )
1333
+ }
1334
+
1335
+ final override Instruction getInstructionSuccessorInternal ( InstructionTag tag , EdgeKind kind ) {
1336
+ tag = OnlyInstructionTag ( ) and
1337
+ result = this .getParent ( ) .getChildSuccessor ( this , kind )
1338
+ }
1339
+
1340
+ final override Instruction getChildSuccessorInternal ( TranslatedElement child , EdgeKind kind ) {
1341
+ child = this .getOperand ( ) and
1342
+ kind instanceof GotoEdge and
1343
+ result = this .getInstruction ( OnlyInstructionTag ( ) )
1344
+ }
1345
+
1346
+ final override Instruction getInstructionRegisterOperand ( InstructionTag tag , OperandTag operandTag ) {
1347
+ tag = OnlyInstructionTag ( ) and
1348
+ operandTag instanceof UnaryOperandTag and
1349
+ result = this .getOperand ( ) .getResult ( )
1350
+ }
1351
+
1352
+ private TranslatedExpr getOperand ( ) {
1353
+ result = getTranslatedExpr ( expr .getOperand ( ) .getFullyConverted ( ) )
1354
+ }
1355
+
1356
+ final override Instruction getResult ( ) { result = this .getInstruction ( OnlyInstructionTag ( ) ) }
1357
+ }
1358
+
1315
1359
/**
1316
1360
* IR translation of a `co_await` or `co_yield` expression.
1317
1361
*
0 commit comments