diff options
| author | gingerBill <bill@gingerbill.org> | 2018-05-12 20:17:12 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-05-12 20:17:12 +0100 |
| commit | 324b7d65e7aa3c4dd5b817daf320974cfe5d0c15 (patch) | |
| tree | d7eb4deec4046f32b398441f7a61bf8d38ebb1df /src/ir.cpp | |
| parent | 373a60b9ef414f857d454bf7907fe9872e9b077f (diff) | |
Use `__type_info_of` internally
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<irValue *>(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: { |