[llvm] r317195 - Update go bindings to use new functions from rL317135.
Sam McCall via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 03:22:26 PDT 2017
Author: sammccall
Date: Thu Nov 2 03:22:26 2017
New Revision: 317195
URL: http://llvm.org/viewvc/llvm-project?rev=317195&view=rev
Log:
Update go bindings to use new functions from rL317135.
This fixes duplicate symbol problems.
Modified:
llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp
llvm/trunk/bindings/go/llvm/DIBuilderBindings.h
llvm/trunk/bindings/go/llvm/dibuilder.go
Modified: llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp?rev=317195&r1=317194&r2=317195&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp (original)
+++ llvm/trunk/bindings/go/llvm/DIBuilderBindings.cpp Thu Nov 2 03:22:26 2017
@@ -29,25 +29,6 @@ void LLVMDIBuilderDestroy(LLVMDIBuilderR
delete d;
}
-void LLVMDIBuilderFinalize(LLVMDIBuilderRef dref) { unwrap(dref)->finalize(); }
-
-LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Dref,
- unsigned Lang, const char *File,
- const char *Dir,
- const char *Producer,
- int Optimized, const char *Flags,
- unsigned RuntimeVersion) {
- DIBuilder *D = unwrap(Dref);
- return wrap(D->createCompileUnit(Lang, D->createFile(File, Dir), Producer,
- Optimized, Flags, RuntimeVersion));
-}
-
-LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Dref, const char *File,
- const char *Dir) {
- DIBuilder *D = unwrap(Dref);
- return wrap(D->createFile(File, Dir));
-}
-
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Dref,
LLVMMetadataRef Scope,
LLVMMetadataRef File,
Modified: llvm/trunk/bindings/go/llvm/DIBuilderBindings.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/DIBuilderBindings.h?rev=317195&r1=317194&r2=317195&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/DIBuilderBindings.h (original)
+++ llvm/trunk/bindings/go/llvm/DIBuilderBindings.h Thu Nov 2 03:22:26 2017
@@ -16,6 +16,7 @@
#include "IRBindings.h"
#include "llvm-c/Core.h"
+#include "llvm-c/DebugInfo.h"
#ifdef __cplusplus
extern "C" {
@@ -30,16 +31,6 @@ typedef struct LLVMOpaqueDIBuilder *LLVM
LLVMDIBuilderRef LLVMNewDIBuilder(LLVMModuleRef m);
void LLVMDIBuilderDestroy(LLVMDIBuilderRef d);
-void LLVMDIBuilderFinalize(LLVMDIBuilderRef d);
-
-LLVMMetadataRef
-LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef D, unsigned Language,
- const char *File, const char *Dir,
- const char *Producer, int Optimized,
- const char *Flags, unsigned RuntimeVersion);
-
-LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef D, const char *File,
- const char *Dir);
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef D,
LLVMMetadataRef Scope,
Modified: llvm/trunk/bindings/go/llvm/dibuilder.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/dibuilder.go?rev=317195&r1=317194&r2=317195&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/dibuilder.go (original)
+++ llvm/trunk/bindings/go/llvm/dibuilder.go Thu Nov 2 03:22:26 2017
@@ -132,12 +132,17 @@ func (d *DIBuilder) CreateCompileUnit(cu
defer C.free(unsafe.Pointer(flags))
result := C.LLVMDIBuilderCreateCompileUnit(
d.ref,
- C.unsigned(cu.Language),
- file, dir,
- producer,
- boolToCInt(cu.Optimized),
- flags,
+ C.LLVMDWARFSourceLanguage(cu.Language),
+ C.LLVMDIBuilderCreateFile(d.ref, file, C.size_t(len(cu.File)), dir, C.size_t(len(cu.Dir))),
+ producer, C.size_t(len(cu.Producer)),
+ C.LLVMBool(boolToCInt(cu.Optimized)),
+ flags, C.size_t(len(cu.Flags)),
C.unsigned(cu.RuntimeVersion),
+ /*SplitName=*/ nil, 0,
+ C.LLVMDWARFEmissionFull,
+ /*DWOId=*/ 0,
+ /*SplitDebugInlining*/ C.LLVMBool(boolToCInt(true)),
+ /*DebugInfoForProfiling*/ C.LLVMBool(boolToCInt(false)),
)
return Metadata{C: result}
}
@@ -148,7 +153,9 @@ func (d *DIBuilder) CreateFile(filename,
defer C.free(unsafe.Pointer(cfilename))
cdir := C.CString(dir)
defer C.free(unsafe.Pointer(cdir))
- result := C.LLVMDIBuilderCreateFile(d.ref, cfilename, cdir)
+ result := C.LLVMDIBuilderCreateFile(d.ref,
+ cfilename, C.size_t(len(filename)),
+ cdir, C.size_t(len(dir)))
return Metadata{C: result}
}
More information about the llvm-commits
mailing list