mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 02:31:28 +00:00
Rename ir_function_pass_tailcall->tailrecursion; Take -fadjust-vector-fields into account when storing field type return-values from functions
This commit is contained in:
parent
06ea71d5be
commit
48ba6a6189
1 changed files with 5 additions and 5 deletions
10
ir.c
10
ir.c
|
@ -638,7 +638,7 @@ bool ir_function_pass_peephole(ir_function *self)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ir_function_pass_tailcall(ir_function *self)
|
||||
bool ir_function_pass_tailrecursion(ir_function *self)
|
||||
{
|
||||
size_t b, p;
|
||||
|
||||
|
@ -738,8 +738,8 @@ bool ir_function_finalize(ir_function *self)
|
|||
}
|
||||
|
||||
if (OPTS_OPTIMIZATION(OPTIM_TAIL_RECURSION)) {
|
||||
if (!ir_function_pass_tailcall(self)) {
|
||||
irerror(self->context, "tailcall optimization pass broke something in `%s`", self->name);
|
||||
if (!ir_function_pass_tailrecursion(self)) {
|
||||
irerror(self->context, "tail-recursion optimization pass broke something in `%s`", self->name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2913,8 +2913,8 @@ tailcall:
|
|||
if (retvalue && retvalue->store != store_return && vec_size(retvalue->life))
|
||||
{
|
||||
/* not to be kept in OFS_RETURN */
|
||||
if (retvalue->vtype == TYPE_FIELD)
|
||||
stmt.opcode = field_store_instr[retvalue->vtype];
|
||||
if (retvalue->vtype == TYPE_FIELD && OPTS_FLAG(ADJUST_VECTOR_FIELDS))
|
||||
stmt.opcode = field_store_instr[retvalue->fieldtype];
|
||||
else
|
||||
stmt.opcode = type_store_instr[retvalue->vtype];
|
||||
stmt.o1.u1 = OFS_RETURN;
|
||||
|
|
Loading…
Reference in a new issue