aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-10-08 12:27:03 +0100
committerGinger Bill <bill@gingerbill.org>2017-10-08 12:27:03 +0100
commit4e42d7df4303470dec5b3c354a9469699f6abf8d (patch)
treede88a4b917a9f7d29b34e2db03a50d05f299b666 /src/ir.cpp
parent580ee5cc4afb6ee15785e57747559d885af16d55 (diff)
Minor code reorganization
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index d5109e074..455dae9d2 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -3232,20 +3232,6 @@ irValue *ir_emit_transmute(irProcedure *proc, irValue *value, Type *t) {
return ir_emit_bitcast(proc, value, dst);
}
-irValue *ir_emit_down_cast(irProcedure *proc, irValue *value, Type *t) {
- GB_ASSERT(is_type_pointer(ir_type(value)));
- gbAllocator allocator = proc->module->allocator;
-
- String field_name = check_down_cast_name(t, type_deref(ir_type(value)));
- GB_ASSERT(field_name.len > 0);
- Selection sel = lookup_field(proc->module->allocator, t, field_name, false);
- irValue *bytes = ir_emit_conv(proc, value, t_u8_ptr);
-
- i64 offset_ = type_offset_of_from_selection(allocator, type_deref(t), sel);
- irValue *offset = ir_const_int(allocator, -offset_);
- irValue *head = ir_emit_ptr_offset(proc, bytes, offset);
- return ir_emit_conv(proc, head, t);
-}
irValue *ir_emit_union_cast(irProcedure *proc, irValue *value, Type *type, TokenPos pos) {
gbAllocator a = proc->module->allocator;