diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-03 18:36:21 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-03 18:36:21 +0300 |
| commit | f4be2429f38faba0c54862055f808cb242a7eb49 (patch) | |
| tree | 84f03075952f2c22ccf774646168a08b2f47b8c6 /src/vec.c | |
| parent | 36de4f902c4eec9f8d918e00cf0bf89d6b670cf5 (diff) | |
| download | qbt-f4be2429f38faba0c54862055f808cb242a7eb49.tar.gz qbt-f4be2429f38faba0c54862055f808cb242a7eb49.zip | |
make regalloc work with ssa form
+ Still not ideal register allocator, but can be improved with some
heuristics and potentially completely replaced in the future if so
desired with graph coloring or something.
Diffstat (limited to 'src/vec.c')
| -rw-r--r-- | src/vec.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -7,13 +7,18 @@ struct vec vec_create(size_t ns) { return (struct vec) { - .n = 0, - .s = 1, - .ns = ns, - .buf = malloc(ns), + .n = 0, + .s = 1, + .ns = ns, + .buf = malloc(ns), }; } +void vec_reset(struct vec *v) +{ + v->n = 0; +} + size_t vec_len(struct vec *v) { return v->n; |
