diff options
| author | gingerBill <bill@gingerbill.org> | 2022-02-16 15:18:22 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-02-16 15:18:22 +0000 |
| commit | 42ad54c28ee013618c7ee0039bbe1ce5dd1f0ba6 (patch) | |
| tree | e6b97b9317ece9868a4f4a7a312c6daebce81651 /src/llvm_backend_debug.cpp | |
| parent | 1857bc7b02eec221bc0d89a4702b9c8c5e003e3f (diff) | |
Improve metadata for `context`
Diffstat (limited to 'src/llvm_backend_debug.cpp')
| -rw-r--r-- | src/llvm_backend_debug.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp index 0e86fbb59..ff1c5c7dc 100644 --- a/src/llvm_backend_debug.cpp +++ b/src/llvm_backend_debug.cpp @@ -1050,5 +1050,10 @@ void lb_add_debug_context_variable(lbProcedure *p, lbAddr const &ctx) { token.string = str_lit("context"); token.pos = pos; - lb_add_debug_local_variable(p, ctx.addr.value, t_context, token); + LLVMValueRef ptr = ctx.addr.value; + while (LLVMIsABitCastInst(ptr)) { + ptr = LLVMGetOperand(ptr, 0); + } + + lb_add_debug_local_variable(p, ptr, t_context, token); } |