harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5ff199a10b2ab68a13a7c5b418f3620ef7d7efc7
parent 625862b61dc0d9ef1cdff227c9bb0cb6b624e0cd
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat, 26 Dec 2020 17:37:59 -0500

gen: simplify alloc_temp & binding_alloc

Diffstat:
Msrc/gen.c | 4+---
Mtodo.txt | 9+++++++++
2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -50,9 +50,8 @@ static void alloc_temp(struct gen_context *ctx, struct qbe_value *val, const struct type *type, const char *fmt) { - gen_temp(ctx, val, &qbe_long, fmt); // XXX: Architecture dependent + gen_temp(ctx, val, qtype_for_type(ctx, type, true), fmt); val->indirect = true; - val->type = qtype_for_type(ctx, type, true); struct qbe_value size; constl(&size, type->size); @@ -64,7 +63,6 @@ binding_alloc(struct gen_context *ctx, const struct scope_object *obj, struct qbe_value *val, const char *fmt) { alloc_temp(ctx, val, obj->type, fmt); - val->indirect = true; struct gen_binding *binding = xcalloc(1, sizeof(struct gen_binding)); binding->name = strdup(val->name); diff --git a/todo.txt b/todo.txt @@ -14,3 +14,12 @@ confidently implement the remainder of the features. general todos, includes spec updates: - zero-length arrays & slice initializers - allocations + + + +storage consistency audit todos: +- aggregate types: allocation, initialization, reading, writing +- pointers, reading and writing, taking pointers to objects +- pointers to aggregate types +- copying entire aggregate types +- nested aggregate types