| 539 | } |
| 540 | |
| 541 | SimNode * SimulateVisitor::sv_makeCopy(const LineInfo & at, ExpressionPtr lE, ExpressionPtr rE ) { |
| 542 | const auto & rightType = *rE->type; |
| 543 | DAS_ASSERT ( (rightType.canCopy() || rightType.isGoodBlockType()) && |
| 544 | "we are calling makeCopy on a type, which can't be copied." |
| 545 | "we should not be here, script compiler should have caught this during compilation." |
| 546 | "compiler later will likely report internal compilation error."); |
| 547 | // now, call with CMRES |
| 548 | if ( rE->rtti_isCall() ) { |
| 549 | auto cll = static_cast<ExprCall*>(rE); |
| 550 | if ( cll->allowCmresSkip() ) { |
| 551 | auto right = getE(rE); |
| 552 | getCallBase(right)->cmresEval = getE(lE); |
| 553 | return right; |
| 554 | } |
| 555 | } |
| 556 | // now, invoke with CMRES |
| 557 | if ( rE->rtti_isInvoke() ) { |
| 558 | auto cll = static_cast<ExprInvoke*>(rE); |
| 559 | if ( cll->allowCmresSkip() ) { |
| 560 | auto right = getE(rE); |
| 561 | getCallBase(right)->cmresEval = getE(lE); |
| 562 | return right; |
| 563 | } |
| 564 | } |
| 565 | // now, to the regular copy |
| 566 | auto left = getE(lE); |
| 567 | auto right = getE(rE); |
| 568 | if ( rightType.isRef() ) { |
| 569 | return context.code->makeNode<SimNode_CopyRefValue>(at, left, right, rightType.getSizeOf()); |
| 570 | } else { |
| 571 | return context.code->makeValueNode<SimNode_Set>(rightType.getR2VType(), at, left, right); |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | SimNode * SimulateVisitor::sv_makeMove (const LineInfo & at, ExpressionPtr lE, ExpressionPtr rE ) { |
| 576 | const auto & rightType = *rE->type; |
nothing calls this directly
no test coverage detected