From 1e211255270eb43aaf3646d7e62da63b0b855e17 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 12 Jan 2023 21:49:53 +0000 Subject: [PATCH] Split out object generation more --- src/llvm_backend_general.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index 7eb024daf..15cb3f2be 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -329,12 +329,14 @@ gb_internal bool lb_is_instr_terminating(LLVMValueRef instr) { gb_internal lbModule *lb_module_of_entity(lbGenerator *gen, Entity *e) { GB_ASSERT(e != nullptr); - if (e->pkg) { - lbModule **found = nullptr; + lbModule **found = nullptr; + if (e->file) { found = map_get(&gen->modules, cast(void *)e->file); if (found) { return *found; } + } + if (e->pkg) { found = map_get(&gen->modules, cast(void *)e->pkg); if (found) { return *found;