From 304c7594cd2d904072917bb79d0aa340090d8296 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 2 Dec 2018 20:59:08 +0000 Subject: Ignore `ir_emit_byte_swap` for constant values --- src/checker.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 75ff5ea65..44a76db67 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1812,11 +1812,23 @@ void init_core_source_code_location(Checker *c) { void init_core_map_type(Checker *c) { if (t_map_key == nullptr) { - t_map_key = find_core_type(c, str_lit("Map_Key")); + Entity *e = find_core_entity(c, str_lit("Map_Key")); + if (e->state == EntityState_Unresolved) { + auto ctx = c->init_ctx; + check_entity_decl(&ctx, e, nullptr, nullptr); + } + t_map_key = e->type; + GB_ASSERT(t_map_key != nullptr); } if (t_map_header == nullptr) { - t_map_header = find_core_type(c, str_lit("Map_Header")); + Entity *e = find_core_entity(c, str_lit("Map_Header")); + if (e->state == EntityState_Unresolved) { + auto ctx = c->init_ctx; + check_entity_decl(&ctx, e, nullptr, nullptr); + } + t_map_header = e->type; + GB_ASSERT(t_map_header != nullptr); } } -- cgit v1.2.3