aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-12-20 14:56:44 +0000
committergingerBill <bill@gingerbill.org>2022-12-20 14:56:44 +0000
commit44caa96d50574131e3615958eedc881e68c90905 (patch)
tree9d4dbf6e994b204e1b90cc2bf276bc40d7368c27 /src/llvm_backend.cpp
parenteb0775ad53e9651ca01ad236dd3fe83786f0cecc (diff)
Set the file's filename and directory in `init_ast_file`
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index c5bc96eb9..146cb2944 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -1740,12 +1740,9 @@ gb_internal void lb_generate_code(lbGenerator *gen) {
if (m->debug_builder) { // Debug Info
for (auto const &file_entry : info->files) {
AstFile *f = file_entry.value;
- String fullpath = f->fullpath;
- String filename = remove_directory_from_path(fullpath);
- String directory = directory_from_path(fullpath);
LLVMMetadataRef res = LLVMDIBuilderCreateFile(m->debug_builder,
- cast(char const *)filename.text, filename.len,
- cast(char const *)directory.text, directory.len);
+ cast(char const *)f->filename.text, f->filename.len,
+ cast(char const *)f->directory.text, f->directory.len);
lb_set_llvm_metadata(m, f, res);
}