diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-02 00:05:51 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-02 00:05:51 +0000 |
| commit | 3b583cbac752435ec9385201f27438c96b6f8f7b (patch) | |
| tree | 4c6db55b073717dc6f4178325e6052bba4871303 /src/llvm_backend.cpp | |
| parent | 382bd87667a275f9b276886f7c1e8caac4dda5f6 (diff) | |
Add debug symbols for global constants of integers, bools, enums, runes, & pointers.
Variables are namespaced with `pkg::name` or `name` if built-in or the initial package for convenience.
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index b6e9cc423..1d2c00700 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -1736,6 +1736,13 @@ void lb_generate_code(lbGenerator *gen) { lbProcedure *startup_runtime = lb_create_startup_runtime(default_module, startup_type_info, objc_names, global_variables); gb_unused(startup_runtime); + if (build_context.ODIN_DEBUG) { + for_array(i, builtin_pkg->scope->elements.entries) { + Entity *e = builtin_pkg->scope->elements.entries[i].value; + add_debug_info_for_global_constant_from_entity(gen, e); + } + } + TIME_SECTION("LLVM Global Procedures and Types"); for_array(i, info->entities) { Entity *e = info->entities[i]; @@ -1759,6 +1766,11 @@ void lb_generate_code(lbGenerator *gen) { case Entity_TypeName: case Entity_Procedure: break; + case Entity_Constant: + if (build_context.ODIN_DEBUG) { + add_debug_info_for_global_constant_from_entity(gen, e); + } + break; } bool polymorphic_struct = false; @@ -1820,6 +1832,21 @@ void lb_generate_code(lbGenerator *gen) { lb_finalize_objc_names(objc_names); if (build_context.ODIN_DEBUG) { + TIME_SECTION("LLVM Debug Info for global constant value declarations"); + { + // lbModule *m = default_module; + + + } + // if (gen->modules.entries.count == 1) { + // } else { + // for_array(j, gen->modules.entries) { + // lbModule *m = gen->modules.entries[j].value; + // if (m->debug_builder != nullptr) { + // } + // } + // } + TIME_SECTION("LLVM Debug Info Complete Types and Finalize"); for_array(j, gen->modules.entries) { lbModule *m = gen->modules.entries[j].value; |