summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-05-10 21:10:06 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-05-10 21:10:06 +0000
commit07e5114430d63dd44e9ab4737c1d23806d6d8daa (patch)
treef7c983e6e6bd445a9de5c7b97e89ce0e5a7e1e06 /bindings
parent70d549800ca6fdbe0f187a50c56b3ea53a5ba64c (diff)
[LLVM-C] Consolidate llgo's DIBuilder Bindings
Summary: Move and correct LLVMDIBuilderCreateTypedef. This is the last API in DIBuilderBindings.h, so it is being removed and the C API will now be re-exported from IRBindings.h. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46725 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/go/llvm/DIBuilderBindings.cpp30
-rw-r--r--bindings/go/llvm/DIBuilderBindings.h40
-rw-r--r--bindings/go/llvm/IRBindings.h1
-rw-r--r--bindings/go/llvm/dibuilder.go3
4 files changed, 3 insertions, 71 deletions
diff --git a/bindings/go/llvm/DIBuilderBindings.cpp b/bindings/go/llvm/DIBuilderBindings.cpp
deleted file mode 100644
index 27845223353..00000000000
--- a/bindings/go/llvm/DIBuilderBindings.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===- DIBuilderBindings.cpp - Bindings for DIBuilder ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines C bindings for the DIBuilder class.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DIBuilderBindings.h"
-#include "IRBindings.h"
-#include "llvm/IR/DIBuilder.h"
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/Module.h"
-
-using namespace llvm;
-
-LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Dref,
- LLVMMetadataRef Ty, const char *Name,
- LLVMMetadataRef File, unsigned Line,
- LLVMMetadataRef Context) {
- DIBuilder *D = unwrap(Dref);
- return wrap(D->createTypedef(unwrap<DIType>(Ty), Name,
- File ? unwrap<DIFile>(File) : nullptr, Line,
- Context ? unwrap<DIScope>(Context) : nullptr));
-}
diff --git a/bindings/go/llvm/DIBuilderBindings.h b/bindings/go/llvm/DIBuilderBindings.h
deleted file mode 100644
index 4350d208169..00000000000
--- a/bindings/go/llvm/DIBuilderBindings.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===- DIBuilderBindings.h - Bindings for DIBuilder -------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines C bindings for the DIBuilder class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_BINDINGS_GO_LLVM_DIBUILDERBINDINGS_H
-#define LLVM_BINDINGS_GO_LLVM_DIBUILDERBINDINGS_H
-
-#include "IRBindings.h"
-#include "llvm-c/Core.h"
-#include "llvm-c/DebugInfo.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// FIXME: These bindings shouldn't be Go-specific and should eventually move to
-// a (somewhat) less stable collection of C APIs for use in creating bindings of
-// LLVM in other languages.
-
-typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
-
-LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef D,
- LLVMMetadataRef Ty, const char *Name,
- LLVMMetadataRef File, unsigned Line,
- LLVMMetadataRef Context);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif
diff --git a/bindings/go/llvm/IRBindings.h b/bindings/go/llvm/IRBindings.h
index a2f7d2db57d..66b328c4325 100644
--- a/bindings/go/llvm/IRBindings.h
+++ b/bindings/go/llvm/IRBindings.h
@@ -15,6 +15,7 @@
#define LLVM_BINDINGS_GO_LLVM_IRBINDINGS_H
#include "llvm-c/Core.h"
+#include "llvm-c/DebugInfo.h"
#ifdef __cplusplus
#include "llvm/IR/Metadata.h"
#include "llvm/Support/CBindingWrapping.h"
diff --git a/bindings/go/llvm/dibuilder.go b/bindings/go/llvm/dibuilder.go
index ce7247af15b..8ec8f3cd280 100644
--- a/bindings/go/llvm/dibuilder.go
+++ b/bindings/go/llvm/dibuilder.go
@@ -14,7 +14,7 @@
package llvm
/*
-#include "DIBuilderBindings.h"
+#include "IRBindings.h"
#include <stdlib.h>
*/
import "C"
@@ -514,6 +514,7 @@ func (d *DIBuilder) CreateTypedef(t DITypedef) Metadata {
d.ref,
t.Type.C,
name,
+ C.size_t(len(t.Name)),
t.File.C,
C.unsigned(t.Line),
t.Context.C,