aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-12 21:49:53 +0000
committergingerBill <bill@gingerbill.org>2023-01-12 21:49:53 +0000
commit1e211255270eb43aaf3646d7e62da63b0b855e17 (patch)
treec657c8424a5185c61789db78625fd8b82609e8f6 /src/llvm_backend_general.cpp
parent4a8c37dd529e9f09583101f086833cec2c1b71ce (diff)
Split out object generation more
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp6
1 files 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;