summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ir.h3
-rw-r--r--test.lang7
2 files changed, 4 insertions, 6 deletions
diff --git a/ir.h b/ir.h
index d640f5a..ccc2348 100644
--- a/ir.h
+++ b/ir.h
@@ -31,10 +31,13 @@ typedef struct Type {
} Type;
typedef struct Value {
+ /* TODO: maybe move type to end for alignment reasons */
Type type;
union {
int64_t i;
uint64_t u;
+ /* TODO:
+ * maybe can use a slice instead of dynamic array, save 8 bytes */
DYNARR(struct Value) tuple;
};
} Value;
diff --git a/test.lang b/test.lang
index dc6e4cf..eb4e1a3 100644
--- a/test.lang
+++ b/test.lang
@@ -1,8 +1,3 @@
func main(a, b i64) i64 {
- let x = 2
- if a < b {
- let z = 3
- x := 3
- }
- return a + x
+ return a + b + 3
}