MCPcopy Create free account
hub / github.com/anjo76/angelscript / ConvertToTempVariable

Method ConvertToTempVariable

sdk/angelscript/source/as_compiler.cpp:15529–15553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15527}
15528
15529void asCCompiler::ConvertToTempVariable(asCExprContext *ctx)
15530{
15531 // This is only used for primitive types and null handles
15532 asASSERT( ctx->type.dataType.IsPrimitive() || ctx->type.dataType.IsNullHandle() );
15533
15534 ConvertToVariable(ctx);
15535 if( !ctx->type.isTemporary )
15536 {
15537 if( ctx->type.dataType.IsPrimitive() )
15538 {
15539 // Copy the variable to a temporary variable
15540 int offset = AllocateVariable(ctx->type.dataType, true);
15541 if( ctx->type.dataType.GetSizeInMemoryDWords() == 1 )
15542 ctx->bc.InstrW_W(asBC_CpyVtoV4, offset, ctx->type.stackOffset);
15543 else
15544 ctx->bc.InstrW_W(asBC_CpyVtoV8, offset, ctx->type.stackOffset);
15545 ctx->type.SetVariable(ctx->type.dataType, offset, true);
15546 }
15547 else
15548 {
15549 // We should never get here
15550 asASSERT(false);
15551 }
15552 }
15553}
15554
15555void asCCompiler::ConvertToVariable(asCExprContext *ctx)
15556{

Callers

nothing calls this directly

Calls 5

IsPrimitiveMethod · 0.80
IsNullHandleMethod · 0.80
GetSizeInMemoryDWordsMethod · 0.80
InstrW_WMethod · 0.80
SetVariableMethod · 0.80

Tested by

no test coverage detected