mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-19 16:11:30 +00:00
Use __type_info_of internally
This commit is contained in:
+1
-1
@@ -3422,7 +3422,7 @@ bool check_builtin_procedure(Checker *c, Operand *operand, AstNode *call, i32 id
|
||||
add_type_info_type(c, t);
|
||||
|
||||
if (is_operand_value(o) && is_type_typeid(t)) {
|
||||
// Okay
|
||||
add_preload_dependency(c, "__type_info_of");
|
||||
} else if (o.mode != Addressing_Type) {
|
||||
error(ce->args[0], "Expected a type or typeid for 'type_info_of'");
|
||||
return false;
|
||||
|
||||
+4
-2
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user