Go bindings: add DIBuilder.InsertValueAtEnd
[oota-llvm.git] / bindings / go / llvm / DIBuilderBindings.cpp
index 94fa96f..cb7ac8d 100644 (file)
@@ -19,8 +19,7 @@
 using namespace llvm;
 
 namespace {
-template <typename T>
-T unwrapDI(LLVMValueRef v) {
+template <typename T> T unwrapDI(LLVMValueRef v) {
   return v ? T(unwrap<MDNode>(v)) : T();
 }
 }
@@ -220,3 +219,15 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Dref,
                        unwrapDI<DIExpression>(Expr), unwrap(Block));
   return wrap(Instr);
 }
+
+LLVMValueRef LLVMDIBuilderInsertValueAtEnd(LLVMDIBuilderRef Dref,
+                                           LLVMValueRef Val, uint64_t Offset,
+                                           LLVMValueRef VarInfo,
+                                           LLVMValueRef Expr,
+                                           LLVMBasicBlockRef Block) {
+  DIBuilder *D = unwrap(Dref);
+  Instruction *Instr = D->insertDbgValueIntrinsic(
+      unwrap(Val), Offset, unwrapDI<DIVariable>(VarInfo),
+      unwrapDI<DIExpression>(Expr), unwrap(Block));
+  return wrap(Instr);
+}