aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-09-04 22:32:23 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-09-04 22:32:23 -0700
commit20eb749ad6983d74ce8285a725d84248d41fca00 (patch)
tree9444a3a8983dad943ca9f07c998f170fe98a06b8 /src/zig_llvm.cpp
parent4e7effd3d38894f4d00bb0bb51ed34e237a4167e (diff)
downloadzig-20eb749ad6983d74ce8285a725d84248d41fca00.tar.gz
zig-20eb749ad6983d74ce8285a725d84248d41fca00.zip
generate debug info for global constants
See #41
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 4efd64807a..969e624d4c 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -401,6 +401,22 @@ LLVMZigDILocalVariable *LLVMZigCreateAutoVariable(LLVMZigDIBuilder *dbuilder,
return reinterpret_cast<LLVMZigDILocalVariable*>(result);
}
+LLVMZigDIGlobalVariable *LLVMZigCreateGlobalVariable(LLVMZigDIBuilder *dbuilder,
+ LLVMZigDIScope *scope, const char *name, const char *linkage_name, LLVMZigDIFile *file,
+ unsigned line_no, LLVMZigDIType *di_type, bool is_local_to_unit, LLVMValueRef constant_val)
+{
+ DIGlobalVariable *result = reinterpret_cast<DIBuilder*>(dbuilder)->createGlobalVariable(
+ reinterpret_cast<DIScope*>(scope),
+ name,
+ linkage_name,
+ reinterpret_cast<DIFile*>(file),
+ line_no,
+ reinterpret_cast<DIType*>(di_type),
+ is_local_to_unit,
+ reinterpret_cast<llvm::Constant *>(constant_val));
+ return reinterpret_cast<LLVMZigDIGlobalVariable*>(result);
+}
+
LLVMZigDILocalVariable *LLVMZigCreateParameterVariable(LLVMZigDIBuilder *dbuilder,
LLVMZigDIScope *scope, const char *name, LLVMZigDIFile *file, unsigned line_no,
LLVMZigDIType *type, bool always_preserve, unsigned flags, unsigned arg_no)