From fee504636f9cd7633217e1877ee1b99e555bba63 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Mon, 3 Oct 2016 23:28:37 +0100 Subject: Code clean up of call arguments --- src/codegen/ssa.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/ssa.cpp b/src/codegen/ssa.cpp index e8aa3bebf..b355f2acc 100644 --- a/src/codegen/ssa.cpp +++ b/src/codegen/ssa.cpp @@ -1799,7 +1799,7 @@ ssaValue *ssa_emit_conv(ssaProcedure *proc, ssaValue *value, Type *t, b32 is_arg // NOTE(bill): This has to be done beofre `Pointer <-> Pointer` as it's // subtype polymorphism casting - if (is_argument) { + if (true || is_argument) { Type *sb = base_type(type_deref(src)); b32 src_is_ptr = src != sb; if (is_type_struct(sb)) { @@ -1924,8 +1924,9 @@ ssaValue *ssa_emit_transmute(ssaProcedure *proc, ssaValue *value, Type *t) { Type *src = base_type(src_type); Type *dst = base_type(t); - if (are_types_identical(t, src_type)) + if (are_types_identical(t, src_type)) { return value; + } i64 sz = type_size_of(proc->module->sizes, proc->module->allocator, src); i64 dz = type_size_of(proc->module->sizes, proc->module->allocator, dst); @@ -1950,8 +1951,6 @@ ssaValue *ssa_emit_down_cast(ssaProcedure *proc, ssaValue *value, Type *t) { Type *t_u8_ptr = make_type_pointer(allocator, t_u8); ssaValue *bytes = ssa_emit_conv(proc, value, t_u8_ptr); - // IMPORTANT TODO(bill): THIS ONLY DOES ONE LAYER DEEP!!! FUCKING HELL THIS IS NOT WHAT I SIGNED UP FOR! - i64 offset_ = type_offset_of_from_selection(proc->module->sizes, allocator, type_deref(t), sel); ssaValue *offset = ssa_make_const_int(allocator, -offset_); ssaValue *head = ssa_emit_ptr_offset(proc, bytes, offset); -- cgit v1.2.3