diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-07-09 15:27:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-09 15:27:45 +0100 |
| commit | 9782d7b928a0aea4ed86f6a51ef8593bcc14fb7e (patch) | |
| tree | bf26703022465f3902fbf4fc5e29da54ba61e1ba /src/llvm_backend_general.cpp | |
| parent | 9575d85f1aadf6ad501328990b9017d825096750 (diff) | |
| parent | 5627af582a7882c640f0f4c5b285bafb6377fce1 (diff) | |
Merge pull request #3896 from odin-lang/cached-builds
Internal Cached Builds
Diffstat (limited to 'src/llvm_backend_general.cpp')
| -rw-r--r-- | src/llvm_backend_general.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index 77f78a24c..bbeff562c 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -126,16 +126,17 @@ gb_internal bool lb_init_generator(lbGenerator *gen, Checker *c) { m->gen = gen; map_set(&gen->modules, cast(void *)pkg, m); lb_init_module(m, c); - if (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); - } + if (!module_per_file) { + continue; + } + // 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); } } } @@ -144,7 +145,6 @@ gb_internal bool lb_init_generator(lbGenerator *gen, Checker *c) { map_set(&gen->modules, cast(void *)1, &gen->default_module); lb_init_module(&gen->default_module, c); - for (auto const &entry : gen->modules) { lbModule *m = entry.value; LLVMContextRef ctx = LLVMGetModuleContext(m->mod); |