diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-02-24 01:48:49 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-02-24 01:48:49 -0500 |
commit | bd43a4040d764909cd441063ece569006d265b98 (patch) | |
tree | 17055eaea6a0f9fc03e70d9072518d67bfcfc0ce | |
parent | ad3c3ba2b42ec6190faa7549a00e92d42fcbad9a (diff) |
stub mk_tmp
-rw-r--r-- | compiler.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -3552,8 +3552,13 @@ int _scope_avail_reg(Scope *s) { } // Creates a new tmp variable from an existing variable -Variable scope_mk_tmp(Variable *v) { - return *v; +Variable scope_mk_tmp(Scope *s, Variable *v) { + Variable out = var_copy(v); + if (is_inbuilt(v->type->name) || _var_ptr_type(v) < 1) { + int regs = _scope_avail_reg(s); + } + // TODO + return out; } // Checks if a variable is a tmp variable in the scope @@ -3839,7 +3844,7 @@ Variable _eval(Scope *s, CompData *data, Vector *tokens, size_t start, size_t en Variable rhs = _eval(s, data, tokens, op_pos + 1, end); out = _eval(s, data, tokens, start, op_pos); if (op != 10 && !scope_is_tmp(&out)) { - out = scope_mk_tmp(&out); + out = scope_mk_tmp(s, &out); } if (strlen(op_token->data) == 1) { |