| 573 | } |
| 574 | |
| 575 | SimNode * SimulateVisitor::sv_makeMove (const LineInfo & at, ExpressionPtr lE, ExpressionPtr rE ) { |
| 576 | const auto & rightType = *rE->type; |
| 577 | // now, call with CMRES |
| 578 | if ( rE->rtti_isCall() ) { |
| 579 | auto cll = static_cast<ExprCall*>(rE); |
| 580 | if ( cll->allowCmresSkip() ) { |
| 581 | auto right = getE(rE); |
| 582 | getCallBase(right)->cmresEval = getE(lE); |
| 583 | return right; |
| 584 | } |
| 585 | } |
| 586 | // now, invoke with CMRES |
| 587 | if ( rE->rtti_isInvoke() ) { |
| 588 | auto cll = static_cast<ExprInvoke*>(rE); |
| 589 | if ( cll->allowCmresSkip() ) { |
| 590 | auto right = getE(rE); |
| 591 | getCallBase(right)->cmresEval = getE(lE); |
| 592 | return right; |
| 593 | } |
| 594 | } |
| 595 | // now to the regular one |
| 596 | if ( rightType.isRef() ) { |
| 597 | auto left = getE(lE); |
| 598 | auto right = getE(rE); |
| 599 | return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf()); |
| 600 | } else { |
| 601 | // this here might happen during initialization, by moving value types |
| 602 | // like var t <- 5 |
| 603 | // its ok to generate simplified set here |
| 604 | auto left = getE(lE); |
| 605 | auto right = getE(rE); |
| 606 | return context.code->makeValueNode<SimNode_Set>(rightType.getR2VType(), at, left, right); |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | SimNode * Function::makeSimNode ( Context & context, const vector<ExpressionPtr> & ) { |
| 611 | if ( copyOnReturn || moveOnReturn ) { |
nothing calls this directly
no test coverage detected