From 6cc51d3c3311a5d37401ec141424b30f57f62693 Mon Sep 17 00:00:00 2001 From: antlilja Date: Thu, 22 Feb 2024 16:07:25 +0100 Subject: [PATCH] LLVM: Set new debug location after inlining --- src/codegen/llvm.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 39bfb0ac02..26ab6960bd 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -6625,6 +6625,13 @@ pub const FuncGen = struct { ); self.scope = lexical_block; self.base_line = decl.src_line; + const inlined_at = self.wip.current_debug_location; + self.wip.current_debug_location = try o.builder.debugLocation( + line_number, + 0, + self.scope, + inlined_at, + ); return .none; } @@ -6641,6 +6648,7 @@ pub const FuncGen = struct { const old = self.inlined.pop(); self.scope = old.scope; self.base_line = old.base_line; + self.wip.current_debug_location = old.location; return .none; }