aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/codegen.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-07 19:23:00 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-07 19:23:00 +0100
commit7ba13a18a33d8f852eb41b58da662ddb4649d04f (patch)
tree89663aff3ad0c5e5f62a3432d269dcee050a71ed /src/codegen/codegen.cpp
parent2c4193a24226b084797af61e29c8355835c179a8 (diff)
Basic variadic `print` procedure
Diffstat (limited to 'src/codegen/codegen.cpp')
-rw-r--r--src/codegen/codegen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/codegen.cpp b/src/codegen/codegen.cpp
index 5d8df5060..13a362ce5 100644
--- a/src/codegen/codegen.cpp
+++ b/src/codegen/codegen.cpp
@@ -238,7 +238,7 @@ void ssa_gen_tree(ssaGen *s) {
case Basic_uint: {
tag = ssa_add_local_generated(proc, t_type_info_integer);
b32 is_unsigned = (basic_types[t->Basic.kind].flags & BasicFlag_Unsigned) != 0;
- ssaValue *bits = ssa_make_value_constant(a, t_int, make_exact_value_integer(8*type_size_of(m->sizes, a, t)));
+ ssaValue *bits = ssa_make_value_constant(a, t_int, make_exact_value_integer(type_size_of(m->sizes, a, t)));
ssaValue *is_signed = ssa_make_value_constant(a, t_bool, make_exact_value_bool(!is_unsigned));
ssa_emit_store(proc, ssa_emit_struct_gep(proc, tag, v_zero32, t_int_ptr), bits);
ssa_emit_store(proc, ssa_emit_struct_gep(proc, tag, v_one32, t_bool_ptr), is_signed);
@@ -247,7 +247,7 @@ void ssa_gen_tree(ssaGen *s) {
case Basic_f32:
case Basic_f64: {
tag = ssa_add_local_generated(proc, t_type_info_float);
- ssaValue *bits = ssa_make_value_constant(a, t_int, make_exact_value_integer(8*type_size_of(m->sizes, a, t)));
+ ssaValue *bits = ssa_make_value_constant(a, t_int, make_exact_value_integer(type_size_of(m->sizes, a, t)));
ssa_emit_store(proc, ssa_emit_struct_gep(proc, tag, v_zero32, t_int_ptr), bits);
} break;