From 324b7d65e7aa3c4dd5b817daf320974cfe5d0c15 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 12 May 2018 20:17:12 +0100 Subject: Use `__type_info_of` internally --- src/ir.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 20f1cb947..7197534ae 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4216,8 +4216,10 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv return ir_type_info(proc, t); } GB_ASSERT(is_type_typeid(tav.type)); - irValue *id = ir_emit_bitcast(proc, ir_build_expr(proc, arg), t_uintptr); - return ir_emit_array_ep(proc, ir_global_type_info_data, id); + + auto args = array_make(proc->module->allocator, 1); + args[0] = ir_build_expr(proc, arg); + return ir_emit_global_call(proc, "__type_info_of", args); } case BuiltinProc_typeid_of: { -- cgit v1.2.3