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:
Wolfgang (Blub) Bumiller 2012-06-29 14:37:12 +02:00
parent 856c9d16a5
commit 67b75055b2
2 changed files with 4 additions and 1 deletions

View file

@ -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
View file

@ -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!