From b55b1ffe14bc4a7459cd9b9bdb8b9b0c8f7f8091 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 11 Nov 2018 17:08:30 +0000 Subject: `opaque` keyword and type --- src/ir.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 6f1637b7a..39c7eb25c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2273,6 +2273,10 @@ irDebugInfo *ir_add_debug_info_type(irModule *module, Type *type, Entity *e, irD return di; } + if (is_type_opaque(type)) { + return ir_add_debug_info_type(module, strip_opaque_type(type), e, scope, file); + } + if (is_type_struct(type) || is_type_union(type) || is_type_enum(type) || is_type_tuple(type)) { if (type->kind == Type_Named) { @@ -9455,10 +9459,14 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 3), ir_const_i64(t->BitSet.upper)); break; - - + case Type_Opaque: + ir_emit_comment(proc, str_lit("Type_Opaque")); + tag = ir_emit_conv(proc, variant_ptr, t_type_info_opaque_ptr); + ir_emit_store(proc, ir_emit_struct_ep(proc, tag, 0), ir_get_type_info_ptr(proc, t->Opaque.elem)); + break; } + if (tag != nullptr) { Type *tag_type = type_deref(ir_type(tag)); GB_ASSERT(is_type_named(tag_type)); -- cgit v1.2.3