aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorHayden Gray <35206453+A1029384756@users.noreply.github.com>2025-06-26 16:43:44 -0400
committerGitHub <noreply@github.com>2025-06-26 22:43:44 +0200
commitf72b2b153057e1d629c85af2ea7c54f7928198d5 (patch)
treebe8f9648adf737cc7d9aadef48c3a03a17f7634c /src/llvm_backend_general.cpp
parent22a48d4d9c626419f93212d317ba94d7608f02c3 (diff)
[source-code-locations] - added options to show, obfuscate, and hide source code locations (#5412)
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 5d6a55973..aaa9ffd4d 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -568,10 +568,22 @@ gb_internal void lb_set_file_line_col(lbProcedure *p, Array<lbValue> arr, TokenP
i32 line = pos.line;
i32 col = pos.column;
- if (build_context.obfuscate_source_code_locations) {
+ switch (build_context.source_code_location_info) {
+ case SourceCodeLocationInfo_Normal:
+ break;
+ case SourceCodeLocationInfo_Obfuscated:
file = obfuscate_string(file, "F");
line = obfuscate_i32(line);
col = obfuscate_i32(col);
+ break;
+ case SourceCodeLocationInfo_Filename:
+ file = last_path_element(file);
+ break;
+ case SourceCodeLocationInfo_None:
+ file = str_lit("");
+ line = 0;
+ col = 0;
+ break;
}
arr[0] = lb_find_or_add_entity_string(p->module, file, false);