aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-08 14:48:59 +0100
committergingerBill <bill@gingerbill.org>2024-07-08 14:48:59 +0100
commit8491e2491cd6fe4ea1b5205614f43f1a525cb77f (patch)
treef0319d09749d70f1177f1d46403f0841152252a6 /src/llvm_backend_general.cpp
parent7dd4cccce73dfa7da86e97784a284dfb86cd73f5 (diff)
Experiment with different uses of `-use-separate-modules`
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index db89910dd..f65bc9ac7 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -120,23 +120,22 @@ gb_internal bool lb_init_generator(lbGenerator *gen, Checker *c) {
if (USE_SEPARATE_MODULES) {
for (auto const &entry : gen->info->packages) {
AstPackage *pkg = entry.value;
- #if 1
auto m = gb_alloc_item(permanent_allocator(), lbModule);
m->pkg = pkg;
m->gen = gen;
map_set(&gen->modules, cast(void *)pkg, m);
lb_init_module(m, c);
- #else
- // NOTE(bill): Probably per file is not a good idea, so leave this for later
- for (AstFile *file : pkg->files) {
- auto m = gb_alloc_item(permanent_allocator(), lbModule);
- m->file = file;
- m->pkg = pkg;
- m->gen = gen;
- map_set(&gen->modules, cast(void *)file, m);
- lb_init_module(m, c);
+ if (build_context.module_per_file) {
+ // NOTE(bill): Probably per file is not a good idea, so leave this for later
+ for (AstFile *file : pkg->files) {
+ auto m = gb_alloc_item(permanent_allocator(), lbModule);
+ m->file = file;
+ m->pkg = pkg;
+ m->gen = gen;
+ map_set(&gen->modules, cast(void *)file, m);
+ lb_init_module(m, c);
+ }
}
- #endif
}
}