From ad54d804fef1e1eb646d8ea4bd7ce65363e94fa8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 13 Mar 2019 00:22:31 +0100 Subject: Fix bugs Fix hash map bug on rorder (invalid size). Fix string to int/float conversion in tokenizer. Add more ssa functions --- include/ssa/ssa.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ssa/ssa.h b/include/ssa/ssa.h index a21b45a..5411259 100644 --- a/include/ssa/ssa.h +++ b/include/ssa/ssa.h @@ -27,7 +27,10 @@ typedef enum { } SsaNumberType; typedef struct { - i64 value; + union { + i64 integer; + f64 floating; + } value; SsaNumberType type; } SsaNumber; @@ -44,7 +47,8 @@ typedef struct { } Ssa; /* None of these functions are thread-safe */ -SsaNumber create_ssa_number(i64 value, SsaNumberType type); +SsaNumber create_ssa_integer(i64 value); +SsaNumber create_ssa_float(f64 value); CHECK_RESULT int ssa_init(Ssa *self, ScopedAllocator *allocator); CHECK_RESULT int ssa_get_unique_reg(Ssa *self, SsaRegister *result); -- cgit v1.2.3