llvm.org GIT mirror llvm / 6a45ba3
Update go bindings to use new functions from rL317135. This fixes duplicate symbol problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317195 91177308-0d34-0410-b5e6-96231b3b80d8 Sam McCall 3 years ago
3 changed file(s) with 14 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
2626 void LLVMDIBuilderDestroy(LLVMDIBuilderRef dref) {
2727 DIBuilder *d = unwrap(dref);
2828 delete d;
29 }
30
31 void LLVMDIBuilderFinalize(LLVMDIBuilderRef dref) { unwrap(dref)->finalize(); }
32
33 LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Dref,
34 unsigned Lang, const char *File,
35 const char *Dir,
36 const char *Producer,
37 int Optimized, const char *Flags,
38 unsigned RuntimeVersion) {
39 DIBuilder *D = unwrap(Dref);
40 return wrap(D->createCompileUnit(Lang, D->createFile(File, Dir), Producer,
41 Optimized, Flags, RuntimeVersion));
42 }
43
44 LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Dref, const char *File,
45 const char *Dir) {
46 DIBuilder *D = unwrap(Dref);
47 return wrap(D->createFile(File, Dir));
4829 }
4930
5031 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Dref,
1515
1616 #include "IRBindings.h"
1717 #include "llvm-c/Core.h"
18 #include "llvm-c/DebugInfo.h"
1819
1920 #ifdef __cplusplus
2021 extern "C" {
2930 LLVMDIBuilderRef LLVMNewDIBuilder(LLVMModuleRef m);
3031
3132 void LLVMDIBuilderDestroy(LLVMDIBuilderRef d);
32 void LLVMDIBuilderFinalize(LLVMDIBuilderRef d);
33
34 LLVMMetadataRef
35 LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef D, unsigned Language,
36 const char *File, const char *Dir,
37 const char *Producer, int Optimized,
38 const char *Flags, unsigned RuntimeVersion);
39
40 LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef D, const char *File,
41 const char *Dir);
4233
4334 LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef D,
4435 LLVMMetadataRef Scope,
131131 defer C.free(unsafe.Pointer(flags))
132132 result := C.LLVMDIBuilderCreateCompileUnit(
133133 d.ref,
134 C.unsigned(cu.Language),
135 file, dir,
136 producer,
137 boolToCInt(cu.Optimized),
138 flags,
134 C.LLVMDWARFSourceLanguage(cu.Language),
135 C.LLVMDIBuilderCreateFile(d.ref, file, C.size_t(len(cu.File)), dir, C.size_t(len(cu.Dir))),
136 producer, C.size_t(len(cu.Producer)),
137 C.LLVMBool(boolToCInt(cu.Optimized)),
138 flags, C.size_t(len(cu.Flags)),
139139 C.unsigned(cu.RuntimeVersion),
140 /*SplitName=*/ nil, 0,
141 C.LLVMDWARFEmissionFull,
142 /*DWOId=*/ 0,
143 /*SplitDebugInlining*/ C.LLVMBool(boolToCInt(true)),
144 /*DebugInfoForProfiling*/ C.LLVMBool(boolToCInt(false)),
140145 )
141146 return Metadata{C: result}
142147 }
147152 defer C.free(unsafe.Pointer(cfilename))
148153 cdir := C.CString(dir)
149154 defer C.free(unsafe.Pointer(cdir))
150 result := C.LLVMDIBuilderCreateFile(d.ref, cfilename, cdir)
155 result := C.LLVMDIBuilderCreateFile(d.ref,
156 cfilename, C.size_t(len(filename)),
157 cdir, C.size_t(len(dir)))
151158 return Metadata{C: result}
152159 }
153160