MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / sv_makeLocalCMResMove

Method sv_makeLocalCMResMove

src/ast/ast_simulate.cpp:353–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351 }
352
353 SimNode * SimulateVisitor::sv_makeLocalCMResMove (const LineInfo & at, uint32_t offset, ExpressionPtr rE ) {
354 const auto & rightType = *rE->type;
355 // now, call with CMRES
356 if ( rE->rtti_isCall() ) {
357 auto cll = static_cast<ExprCall*>(rE);
358 if ( cll->allowCmresSkip() ) {
359 auto right = getE(rE);
360 getCallBase(right)->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset);
361 return right;
362 }
363 }
364 // now, invoke with CMRES
365 if ( rE->rtti_isInvoke() ) {
366 auto cll = static_cast<ExprInvoke*>(rE);
367 if ( cll->allowCmresSkip() ) {
368 auto * right = getE(rE);
369 getCallBase(right)->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset);
370 return right;
371 }
372 }
373 // now, to the regular move
374 auto left = context.code->makeNode<SimNode_GetCMResOfs>(at, offset);
375 auto right = getE(rE);
376 if ( rightType.isRef() ) {
377 return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf());
378 } else {
379 return context.code->makeValueNode<SimNode_Set>(rightType.getR2VType(), at, left, right);
380 }
381 }
382
383 SimNode * SimulateVisitor::sv_makeLocalCMResCopy(const LineInfo & at, uint32_t offset, ExpressionPtr rE ) {
384 const auto & rightType = *rE->type;

Callers

nothing calls this directly

Calls 4

getCallBaseFunction · 0.85
isRefMethod · 0.80
getR2VTypeMethod · 0.80
getSizeOfMethod · 0.45

Tested by

no test coverage detected