From d83a26f068f42c6f9cafd25b7038b70553a496d8 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Tue, 15 Mar 2022 18:27:09 +0200 Subject: stage2 llvm: keep track of inlined functions --- src/zig_llvm.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/zig_llvm.cpp') diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 6e3cccafeb..0b0b33b8d9 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -799,6 +799,15 @@ void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, unwrap(builder)->SetCurrentDebugLocation(debug_loc); } +void ZigLLVMSetCurrentDebugLocation2(LLVMBuilderRef builder, unsigned int line, + unsigned int column, ZigLLVMDIScope *scope, ZigLLVMDILocation *inlined_at) +{ + DIScope* di_scope = reinterpret_cast(scope); + DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, column, di_scope, + reinterpret_cast(inlined_at), false); + unwrap(builder)->SetCurrentDebugLocation(debug_loc); +} + void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) { unwrap(builder)->SetCurrentDebugLocation(DebugLoc()); } @@ -1025,6 +1034,14 @@ ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScop return reinterpret_cast(debug_loc.get()); } +ZigLLVMDILocation *ZigLLVMGetDebugLoc2(unsigned line, unsigned col, ZigLLVMDIScope *scope, + ZigLLVMDILocation *inlined_at) { + DIScope* di_scope = reinterpret_cast(scope); + DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, col, di_scope, + reinterpret_cast(inlined_at), false); + return reinterpret_cast(debug_loc.get()); +} + void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) { if (on_state) { FastMathFlags fmf; -- cgit v1.2.3