aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-08 15:30:33 +0100
committergingerBill <bill@gingerbill.org>2024-07-08 15:30:33 +0100
commit2c9ef6907a43c6ea2dd7adf17e36b57cbd756c12 (patch)
tree3f0034aafd6a70a3bb659d083b7cbbe589c4f90d /src/llvm_backend.cpp
parent505dec7b147929b79948d011c88d35b98c433c7a (diff)
Clean up timings messages showing used module count
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 9818c5435..44b6e3839 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -3437,9 +3437,18 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
TIME_SECTION("LLVM Add Foreign Library Paths");
lb_add_foreign_library_paths(gen);
+
+ ////////////////////////////////////////////
+ for (auto const &entry: gen->modules) {
+ lbModule *m = entry.value;
+ if (!lb_is_module_empty(m)) {
+ gen->used_module_count += 1;
+ }
+ }
+
gbString label_object_generation = gb_string_make(heap_allocator(), "LLVM Object Generation");
- if (gen->modules.count > 1) {
- label_object_generation = gb_string_append_fmt(label_object_generation, " (%td modules)", gen->modules.count);
+ if (gen->used_module_count > 1) {
+ label_object_generation = gb_string_append_fmt(label_object_generation, " (%td used modules)", gen->used_module_count);
}
TIME_SECTION_WITH_LEN(label_object_generation, gb_string_length(label_object_generation));