[bindings] Update Go bindings to DIBuilder
[oota-llvm.git] / bindings / go / llvm / DIBuilderBindings.cpp
index 627c09131aa50ab65cd1d781d1307652cf6c24d4..d9d0f7ac96488fce9b637c41a944f2f79c43727c 100644 (file)
@@ -83,21 +83,27 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction(
                                 IsOptimized, unwrap<Function>(Func)));
 }
 
-LLVMMetadataRef LLVMDIBuilderCreateLocalVariable(
-    LLVMDIBuilderRef Dref, unsigned, LLVMMetadataRef Scope,
-    const char *Name, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty,
-    int AlwaysPreserve, unsigned Flags, unsigned ArgNo) {
-  DIBuilder *D = unwrap(Dref);
-  // FIXME: Update the Go bindings to match the DIBuilder API.
-  if (ArgNo)
-    return wrap(D->createParameterVariable(
-        unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), Line,
-        unwrap<DIType>(Ty), AlwaysPreserve, Flags));
+LLVMMetadataRef
+LLVMDIBuilderCreateAutoVariable(LLVMDIBuilderRef Dref, LLVMMetadataRef Scope,
+                                const char *Name, LLVMMetadataRef File,
+                                unsigned Line, LLVMMetadataRef Ty,
+                                int AlwaysPreserve, unsigned Flags) {
+  DIBuilder *D = unwrap(Dref);
   return wrap(D->createAutoVariable(unwrap<DIScope>(Scope), Name,
                                     unwrap<DIFile>(File), Line,
                                     unwrap<DIType>(Ty), AlwaysPreserve, Flags));
 }
 
+LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
+    LLVMDIBuilderRef Dref, LLVMMetadataRef Scope, const char *Name,
+    unsigned ArgNo, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty,
+    int AlwaysPreserve, unsigned Flags) {
+  DIBuilder *D = unwrap(Dref);
+  return wrap(D->createParameterVariable(
+      unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), Line,
+      unwrap<DIType>(Ty), AlwaysPreserve, Flags));
+}
+
 LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Dref,
                                              const char *Name,
                                              uint64_t SizeInBits,