| 10178 | //========================================================================== |
| 10179 | |
| 10180 | bool FxVMFunctionCall::CheckEmitCast(VMFunctionBuilder *build, bool returnit, ExpEmit ®) |
| 10181 | { |
| 10182 | FName funcname = Function->SymbolName; |
| 10183 | if (funcname == NAME___decorate_internal_int__ || |
| 10184 | funcname == NAME___decorate_internal_bool__ || |
| 10185 | funcname == NAME___decorate_internal_float__) |
| 10186 | { |
| 10187 | FxExpression *arg = ArgList[0]; |
| 10188 | if (returnit) |
| 10189 | { |
| 10190 | if (arg->isConstant() && |
| 10191 | (funcname == NAME___decorate_internal_int__ || |
| 10192 | funcname == NAME___decorate_internal_bool__)) |
| 10193 | { // Use immediate version for integers in range |
| 10194 | build->EmitRetInt(0, true, static_cast<FxConstant *>(arg)->GetValue().Int); |
| 10195 | } |
| 10196 | else |
| 10197 | { |
| 10198 | ExpEmit where = arg->Emit(build); |
| 10199 | build->Emit(OP_RET, RET_FINAL, EncodeRegType(where), where.RegNum); |
| 10200 | where.Free(build); |
| 10201 | } |
| 10202 | reg = ExpEmit(); |
| 10203 | reg.Final = true; |
| 10204 | } |
| 10205 | else |
| 10206 | { |
| 10207 | reg = arg->Emit(build); |
| 10208 | } |
| 10209 | return true; |
| 10210 | } |
| 10211 | return false; |
| 10212 | } |
| 10213 | |
| 10214 | //========================================================================== |
| 10215 | // |
nothing calls this directly
no test coverage detected