about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-29 10:21:39 -0700
committerbors <bors@rust-lang.org>2014-03-29 10:21:39 -0700
commit3eb3a02c92e129e87561ebcf927543679bf7c74d (patch)
tree5264691266c132449a0e0bfa9575ad13a29988be /src/rustllvm/RustWrapper.cpp
parent363198bca029802200b4eb7bc75ef7b9340a2496 (diff)
parentf4518cdba7e7b5b40cea2b0549c4593414154829 (diff)
downloadrust-3eb3a02c92e129e87561ebcf927543679bf7c74d.tar.gz
rust-3eb3a02c92e129e87561ebcf927543679bf7c74d.zip
auto merge of #13143 : gentlefolk/rust/issue-9227, r=michaelwoerister
Only supports crate level statics. No debug info is generated for function level statics. Closes #9227.

As discussed at the end of the comments for #9227, I took an initial stab at adding support for function level statics and decided it would be enough work to warrant being split into a separate issue.

See #13144 for the new issue describing the need to add support for function level static variables.
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,