mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
adding another storage type: store_return; when generating a CALL, the generator can check the output value's storetype, and if it is NOT store_return, it needs to STORE_x the return value into the output value.
This commit is contained in:
parent
856c9d16a5
commit
67b75055b2
2 changed files with 4 additions and 1 deletions
3
gmqcc.h
3
gmqcc.h
|
@ -774,7 +774,8 @@ _MEM_VEC_FUN_FIND(Tself, Twhat, mem)
|
|||
enum store_types {
|
||||
store_global,
|
||||
store_local, /* local, assignable for now, should get promoted later */
|
||||
store_value /* unassignable */
|
||||
store_value, /* unassignable */
|
||||
store_return /* unassignable, at OFS_RETURN */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
2
ir.c
2
ir.c
|
@ -2184,6 +2184,8 @@ tailcall:
|
|||
if (instr->opcode >= INSTR_CALL0 && instr->opcode <= INSTR_CALL8) {
|
||||
/* Trivial call translation:
|
||||
* copy all params to OFS_PARM*
|
||||
* if the output's storetype is not store_return,
|
||||
* add append a STORE instruction!
|
||||
*
|
||||
* NOTES on how to do it better without much trouble:
|
||||
* -) The liferanges!
|
||||
|
|
Loading…
Reference in a new issue