| 459 | } |
| 460 | |
| 461 | void PrintLogicItem(std::stringstream &str, LogicExp* exp, int inv, int rev) { |
| 462 | if (exp->subexp) { |
| 463 | str << "("; |
| 464 | PrintLogicExp(str, exp->dest, exp->subexp, inv, rev); |
| 465 | str << ")"; |
| 466 | } |
| 467 | else { |
| 468 | char* op; |
| 469 | int cond = exp->neg; |
| 470 | if (inv) cond = !cond; |
| 471 | if (rev) cond = !cond; |
| 472 | if (cond) { |
| 473 | op = (char*)invopstr(exp->op); |
| 474 | } |
| 475 | else { |
| 476 | op = (char*)opstr(exp->op); |
| 477 | } |
| 478 | if ((exp->op != OP_TEST) && (exp->op != OP_TESTSET)) { |
| 479 | str << exp->op1 << " " << op << " " << exp->op2; |
| 480 | } |
| 481 | else if (op) { |
| 482 | str << op << " " << exp->op2; |
| 483 | } |
| 484 | else { |
| 485 | str << exp->op2; |
| 486 | } |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | void PrintLogicExp(std::stringstream &str, int dest, LogicExp* exp, int inv_, int rev) { |
| 491 | int inv = inv_; |
no test coverage detected