diff options
| author | Hayden Gray <35206453+A1029384756@users.noreply.github.com> | 2025-06-26 16:43:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-26 22:43:44 +0200 |
| commit | f72b2b153057e1d629c85af2ea7c54f7928198d5 (patch) | |
| tree | be8f9648adf737cc7d9aadef48c3a03a17f7634c /src/llvm_backend_const.cpp | |
| parent | 22a48d4d9c626419f93212d317ba94d7608f02c3 (diff) | |
[source-code-locations] - added options to show, obfuscate, and hide source code locations (#5412)
Diffstat (limited to 'src/llvm_backend_const.cpp')
| -rw-r--r-- | src/llvm_backend_const.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp index e897ae282..c3112934e 100644 --- a/src/llvm_backend_const.cpp +++ b/src/llvm_backend_const.cpp @@ -292,12 +292,26 @@ gb_internal lbValue lb_const_source_code_location_const(lbModule *m, String cons i32 line = pos.line; i32 column = 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"); procedure = obfuscate_string(procedure, "P"); - line = obfuscate_i32(line); - column = obfuscate_i32(column); + line = obfuscate_i32(line); + column = obfuscate_i32(column); + break; + case SourceCodeLocationInfo_Filename: + file = last_path_element(file); + break; + case SourceCodeLocationInfo_None: + file = str_lit(""); + procedure = str_lit(""); + + line = 0; + column = 0; + break; } LLVMValueRef fields[4] = {}; |