From 826a02328f616088f29732c9a33f27b2311b2c38 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 2 Nov 2017 01:46:49 +0000 Subject: [PATCH] Revert "Remove some of the go specific C bindings for debug info now that they've been migrated into the main C API." This reverts commits r317151 and 317152 llvm-svn: 317154 --- llvm/bindings/go/llvm/DIBuilderBindings.cpp | 19 +++++++++++++++++++ llvm/bindings/go/llvm/DIBuilderBindings.h | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/llvm/bindings/go/llvm/DIBuilderBindings.cpp b/llvm/bindings/go/llvm/DIBuilderBindings.cpp index ea53694..a43bf97 100644 --- a/llvm/bindings/go/llvm/DIBuilderBindings.cpp +++ b/llvm/bindings/go/llvm/DIBuilderBindings.cpp @@ -29,6 +29,25 @@ void LLVMDIBuilderDestroy(LLVMDIBuilderRef dref) { 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, diff --git a/llvm/bindings/go/llvm/DIBuilderBindings.h b/llvm/bindings/go/llvm/DIBuilderBindings.h index 0f54690..b097f2e 100644 --- a/llvm/bindings/go/llvm/DIBuilderBindings.h +++ b/llvm/bindings/go/llvm/DIBuilderBindings.h @@ -30,6 +30,16 @@ typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef; 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, -- 2.7.4