Index: bindings/go/llvm/DIBuilderBindings.h =================================================================== --- bindings/go/llvm/DIBuilderBindings.h +++ bindings/go/llvm/DIBuilderBindings.h @@ -28,16 +28,6 @@ typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef; -LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef D, - LLVMMetadataRef Scope, - LLVMMetadataRef File, - unsigned Line, unsigned Column); - -LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef D, - LLVMMetadataRef Scope, - LLVMMetadataRef File, - unsigned Discriminator); - LLVMMetadataRef LLVMDIBuilderCreateFunction( LLVMDIBuilderRef D, LLVMMetadataRef Scope, const char *Name, const char *LinkageName, LLVMMetadataRef File, unsigned Line, Index: bindings/go/llvm/DIBuilderBindings.cpp =================================================================== --- bindings/go/llvm/DIBuilderBindings.cpp +++ bindings/go/llvm/DIBuilderBindings.cpp @@ -19,26 +19,6 @@ using namespace llvm; -LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Dref, - LLVMMetadataRef Scope, - LLVMMetadataRef File, - unsigned Line, - unsigned Column) { - DIBuilder *D = unwrap(Dref); - auto *LB = D->createLexicalBlock(unwrap(Scope), - unwrap(File), Line, Column); - return wrap(LB); -} - -LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Dref, - LLVMMetadataRef Scope, - LLVMMetadataRef File, - unsigned Discriminator) { - DIBuilder *D = unwrap(Dref); - return wrap(D->createLexicalBlockFile(unwrap(Scope), - unwrap(File), Discriminator)); -} - LLVMMetadataRef LLVMDIBuilderCreateFunction( LLVMDIBuilderRef Dref, LLVMMetadataRef Scope, const char *Name, const char *LinkageName, LLVMMetadataRef File, unsigned Line, Index: include/llvm-c/DebugInfo.h =================================================================== --- include/llvm-c/DebugInfo.h +++ include/llvm-c/DebugInfo.h @@ -217,6 +217,31 @@ size_t FilenameLen, const char *Directory, size_t DirectoryLen); +/** + * Create a descriptor for a lexical block with the specified parent context. + * \param Builder The \c DIBuilder. + * \param Scope Parent lexical block. + * \param File Source file. + * \param Line The line in the source file. + * \param Column The column in the source file. + */ +LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock( + LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, + LLVMMetadataRef File, unsigned Line, unsigned Col); + +/** + * Create a descriptor for a lexical block with a new file attached. + * \param Builder The \c DIBuilder. + * \param Scope Lexical block. + * \param File Source file. + * \param Discriminator DWARF path discriminator value. + */ +LLVMMetadataRef +LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, + LLVMMetadataRef Scope, + LLVMMetadataRef File, + unsigned Discriminator); + /** * Creates a new DebugLocation that describes a source location. * \param Line The line in the source file. Index: lib/IR/DebugInfo.cpp =================================================================== --- lib/IR/DebugInfo.cpp +++ lib/IR/DebugInfo.cpp @@ -754,6 +754,24 @@ StringRef(Directory, DirectoryLen))); } +LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock( + LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, + LLVMMetadataRef File, unsigned Line, unsigned Col) { + return wrap(unwrap(Builder)->createLexicalBlock(unwrapDI(Scope), + unwrapDI(File), + Line, Col)); +} + +LLVMMetadataRef +LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, + LLVMMetadataRef Scope, + LLVMMetadataRef File, + unsigned Discriminator) { + return wrap(unwrap(Builder)->createLexicalBlockFile(unwrapDI(Scope), + unwrapDI(File), + Discriminator)); +} + LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope,