From f72b2b153057e1d629c85af2ea7c54f7928198d5 Mon Sep 17 00:00:00 2001 From: Hayden Gray <35206453+A1029384756@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:43:44 -0400 Subject: [source-code-locations] - added options to show, obfuscate, and hide source code locations (#5412) --- src/llvm_backend_const.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/llvm_backend_const.cpp') 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] = {}; -- cgit v1.2.3