diff options
| author | gingerBill <ginger.bill.22@gmail.com> | 2016-08-03 14:17:13 +0100 |
|---|---|---|
| committer | gingerBill <ginger.bill.22@gmail.com> | 2016-08-03 14:17:13 +0100 |
| commit | 0e92166d442b120b06db57623a93c6ec43e3fccb (patch) | |
| tree | 3912ff47c21eb848cfd754b745c262f7a4f4b04d /src/codegen/codegen.cpp | |
| parent | 41e7cadb8df4b9833bc3dd827cac32fd3b01ddbd (diff) | |
Slice creation for SliceExpr
Diffstat (limited to 'src/codegen/codegen.cpp')
| -rw-r--r-- | src/codegen/codegen.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/codegen/codegen.cpp b/src/codegen/codegen.cpp index 7e9397580..f799497ca 100644 --- a/src/codegen/codegen.cpp +++ b/src/codegen/codegen.cpp @@ -33,6 +33,14 @@ void ssa_gen_destroy(ssaGen *s) { } void ssa_gen_code(ssaGen *s) { + if (v_zero == NULL) { + v_zero = ssa_make_value_constant(gb_heap_allocator(), t_int, make_exact_value_integer(0)); + v_one = ssa_make_value_constant(gb_heap_allocator(), t_int, make_exact_value_integer(1)); + v_zero32 = ssa_make_value_constant(gb_heap_allocator(), t_i32, make_exact_value_integer(0)); + v_one32 = ssa_make_value_constant(gb_heap_allocator(), t_i32, make_exact_value_integer(1)); + v_two32 = ssa_make_value_constant(gb_heap_allocator(), t_i32, make_exact_value_integer(2)); + } + ssaModule *m = &s->module; CheckerInfo *info = m->info; gbAllocator a = m->allocator; |