aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-12 16:59:16 +0000
committergingerBill <bill@gingerbill.org>2023-01-12 16:59:16 +0000
commit402a165b60dc9de1ef047b44e47c2d38e5cbed6d (patch)
treed86b969e438e395a17c7a1d3cf2d3e9a46da5fd8 /src/llvm_backend_general.cpp
parent34f917018980ceca73e9eaacacd44efab2a1448b (diff)
Correct missing procedures in other build modules which cause a linkage problem
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index dca8c829d..cae3ab1ee 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -2598,7 +2598,15 @@ gb_internal lbValue lb_find_procedure_value_from_entity(lbModule *m, Entity *e)
ignore_body = other_module != m;
lbProcedure *missing_proc = lb_create_procedure(m, e, ignore_body);
- if (!ignore_body) {
+ if (ignore_body) {
+ mutex_lock(&other_module->values_mutex);
+ auto *found = map_get(&other_module->values, e);
+ if (found == nullptr) {
+ lbProcedure *missing_proc_in_other_module = lb_create_procedure(other_module, e, false);
+ array_add(&other_module->missing_procedures_to_check, missing_proc_in_other_module);
+ }
+ mutex_unlock(&other_module->values_mutex);
+ } else {
array_add(&m->missing_procedures_to_check, missing_proc);
}
found = map_get(&m->values, e);