about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorgentlefolk <cemacken@gmail.com>2014-02-20 20:44:29 -0500
committergentlefolk <cemacken@gmail.com>2014-03-27 21:03:44 -0400
commitf4518cdba7e7b5b40cea2b0549c4593414154829 (patch)
tree89b15b04f1080af5878c3d3831e16cd784a8381c /src/rustllvm/RustWrapper.cpp
parent13dafa09f1a80b8b50f41cab42ac2bfd24dfa6b9 (diff)
downloadrust-f4518cdba7e7b5b40cea2b0549c4593414154829.tar.gz
rust-f4518cdba7e7b5b40cea2b0549c4593414154829.zip
Initial support for emitting DWARF for static vars.
Only supports crate level statics. No debug info is generated for
function level statics. Closes #9227.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index aaaf512bcf3..4755c7873fc 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -323,6 +323,28 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateLexicalBlock(
         unwrapDI<DIFile>(File), Line, Col));
 }
 
+extern "C" LLVMValueRef LLVMDIBuilderCreateStaticVariable(
+    DIBuilderRef Builder,
+    LLVMValueRef Context,
+    const char* Name,
+    const char* LinkageName,
+    LLVMValueRef File,
+    unsigned LineNo,
+    LLVMValueRef Ty,
+    bool isLocalToUnit,
+    LLVMValueRef Val,
+    LLVMValueRef Decl = NULL) {
+    return wrap(Builder->createStaticVariable(unwrapDI<DIDescriptor>(Context),
+        Name,
+        LinkageName,
+        unwrapDI<DIFile>(File),
+        LineNo,
+        unwrapDI<DIType>(Ty),
+        isLocalToUnit,
+        unwrap(Val),
+        unwrapDI<MDNode*>(Decl)));
+}
+
 extern "C" LLVMValueRef LLVMDIBuilderCreateLocalVariable(
     DIBuilderRef Builder,
     unsigned Tag,