aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-03-16 20:40:16 +0200
committerGitHub <noreply@github.com>2022-03-16 20:40:16 +0200
commit49c0bb1f33044658909cae4351d931af497ee4e5 (patch)
treeabf9ecce7f08db5b5f92ed30e3fc3f40b926acc3 /src/zig_llvm.cpp
parentd4a7a9ac4cf64ef6bf0b1aed16282c3d8b47b431 (diff)
parentd83a26f068f42c6f9cafd25b7038b70553a496d8 (diff)
downloadzig-49c0bb1f33044658909cae4351d931af497ee4e5.tar.gz
zig-49c0bb1f33044658909cae4351d931af497ee4e5.zip
Merge pull request #11177 from Vexu/dbg_func
Add debug info for inlined calls
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp17
1 files changed, 17 insertions, 0 deletions
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<DIScope*>(scope);
+ DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, column, di_scope,
+ reinterpret_cast<DILocation *>(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<ZigLLVMDILocation*>(debug_loc.get());
}
+ZigLLVMDILocation *ZigLLVMGetDebugLoc2(unsigned line, unsigned col, ZigLLVMDIScope *scope,
+ ZigLLVMDILocation *inlined_at) {
+ DIScope* di_scope = reinterpret_cast<DIScope*>(scope);
+ DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, col, di_scope,
+ reinterpret_cast<DILocation *>(inlined_at), false);
+ return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get());
+}
+
void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) {
if (on_state) {
FastMathFlags fmf;