DebugInfo: Require a DebugLoc in DIBuilder::insertDeclare()
[oota-llvm.git] / bindings / go / llvm / DIBuilderBindings.cpp
index ee2e70a579b614df0e9c88fe3514111b528ef286..e5734a7c0f314264a16d1f7af14aeb1461219f94 100644 (file)
@@ -234,10 +234,14 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Dref,
                                              LLVMMetadataRef VarInfo,
                                              LLVMMetadataRef Expr,
                                              LLVMBasicBlockRef Block) {
+  // Fail immediately here until the llgo folks update their bindings.  The
+  // called function is going to assert out anyway.
+  llvm_unreachable("DIBuilder API change requires a DebugLoc");
+
   DIBuilder *D = unwrap(Dref);
-  Instruction *Instr =
-      D->insertDeclare(unwrap(Storage), unwrap<MDLocalVariable>(VarInfo),
-                       unwrap<MDExpression>(Expr), unwrap(Block));
+  Instruction *Instr = D->insertDeclare(
+      unwrap(Storage), unwrap<MDLocalVariable>(VarInfo),
+      unwrap<MDExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
   return wrap(Instr);
 }
 
@@ -246,9 +250,13 @@ LLVMValueRef LLVMDIBuilderInsertValueAtEnd(LLVMDIBuilderRef Dref,
                                            LLVMMetadataRef VarInfo,
                                            LLVMMetadataRef Expr,
                                            LLVMBasicBlockRef Block) {
+  // Fail immediately here until the llgo folks update their bindings.  The
+  // called function is going to assert out anyway.
+  llvm_unreachable("DIBuilder API change requires a DebugLoc");
+
   DIBuilder *D = unwrap(Dref);
   Instruction *Instr = D->insertDbgValueIntrinsic(
       unwrap(Val), Offset, unwrap<MDLocalVariable>(VarInfo),
-      unwrap<MDExpression>(Expr), unwrap(Block));
+      unwrap<MDExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
   return wrap(Instr);
 }