about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@gmail>2013-08-23 18:45:02 +0200
committerMichael Woerister <michaelwoerister@gmail>2013-09-04 18:38:46 +0200
commitb81ea86530dfd9dff69815b099ba10be274830ea (patch)
tree157b642e9a6d196adf91f9bc3358d514193e6c8e /src/rustllvm/RustWrapper.cpp
parent67555d9bd40a36d93e193fe2d178713481ad445e (diff)
downloadrust-b81ea86530dfd9dff69815b099ba10be274830ea.tar.gz
rust-b81ea86530dfd9dff69815b099ba10be274830ea.zip
debuginfo: Support for variables captured in closures and closure type descriptions.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 54af6fe7e73..376adf24e25 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -724,3 +724,39 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateTemplateTypeParameter(
       LineNo,
       ColumnNo));
 }
+
+extern "C" LLVMValueRef LLVMDIBuilderCreateOpDeref(LLVMTypeRef IntTy)
+{
+    return LLVMConstInt(IntTy, DIBuilder::OpDeref, true);
+}
+
+extern "C" LLVMValueRef LLVMDIBuilderCreateOpPlus(LLVMTypeRef IntTy)
+{
+    return LLVMConstInt(IntTy, DIBuilder::OpPlus, true);
+}
+
+extern "C" LLVMValueRef LLVMDIBuilderCreateComplexVariable(
+    DIBuilderRef Builder,
+    unsigned Tag,
+    LLVMValueRef Scope,
+    const char *Name,
+    LLVMValueRef File,
+    unsigned LineNo,
+    LLVMValueRef Ty,
+    LLVMValueRef* AddrOps,
+    unsigned AddrOpsCount,
+    unsigned ArgNo)
+{
+    llvm::ArrayRef<llvm::Value*> addr_ops((llvm::Value**)AddrOps, AddrOpsCount);
+
+    return wrap(Builder->createComplexVariable(
+        Tag,
+        unwrapDI<DIDescriptor>(Scope),
+        Name,
+        unwrapDI<DIFile>(File),
+        LineNo,
+        unwrapDI<DIType>(Ty),
+        addr_ops,
+        ArgNo
+    ));
+}