| 15527 | } |
| 15528 | |
| 15529 | void 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 | |
| 15555 | void asCCompiler::ConvertToVariable(asCExprContext *ctx) |
| 15556 | { |
nothing calls this directly
no test coverage detected