diff --git a/bindings/go/llvm/dibuilder.go b/bindings/go/llvm/dibuilder.go index 8ec8f3cd280..dbf6237868a 100644 --- a/bindings/go/llvm/dibuilder.go +++ b/bindings/go/llvm/dibuilder.go @@ -299,6 +299,7 @@ func (d *DIBuilder) CreateBasicType(t DIBasicType) Metadata { C.size_t(len(t.Name)), C.uint64_t(t.SizeInBits), C.unsigned(t.Encoding), + C.LLVMDIFlags(0), ) return Metadata{C: result} } diff --git a/include/llvm-c/DebugInfo.h b/include/llvm-c/DebugInfo.h index cee6755f187..fccc163d907 100644 --- a/include/llvm-c/DebugInfo.h +++ b/include/llvm-c/DebugInfo.h @@ -57,6 +57,8 @@ typedef enum { LLVMDIFlagFixedEnum = 1 << 24, LLVMDIFlagThunk = 1 << 25, LLVMDIFlagTrivial = 1 << 26, + LLVMDIFlagBigEndian = 1 << 27, + LLVMDIFlagLittleEndian = 1 << 28, LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5), LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected | LLVMDIFlagPublic, @@ -531,11 +533,13 @@ LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, * \param NameLen Length of type name. * \param SizeInBits Size of the type. * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float. + * \param Flags Flags to encode optional attribute like endianity */ LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, - LLVMDWARFTypeEncoding Encoding); + LLVMDWARFTypeEncoding Encoding, + LLVMDIFlags Flags); /** * Create debugging information entry for a pointer. diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 659c924b2fc..037c2ea31a5 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -948,9 +948,11 @@ LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, - LLVMDWARFTypeEncoding Encoding) { + LLVMDWARFTypeEncoding Encoding, + LLVMDIFlags Flags) { return wrap(unwrap(Builder)->createBasicType({Name, NameLen}, - SizeInBits, Encoding)); + SizeInBits, Encoding, + map_from_llvmDIFlags(Flags))); } LLVMMetadataRef LLVMDIBuilderCreatePointerType( diff --git a/tools/llvm-c-test/debuginfo.c b/tools/llvm-c-test/debuginfo.c index 74d215ea818..d02c017b8cb 100644 --- a/tools/llvm-c-test/debuginfo.c +++ b/tools/llvm-c-test/debuginfo.c @@ -68,7 +68,7 @@ int llvm_test_dibuilder(void) { NULL, 0); LLVMMetadataRef Int64Ty = - LLVMDIBuilderCreateBasicType(DIB, "Int64", 5, 64, 0); + LLVMDIBuilderCreateBasicType(DIB, "Int64", 5, 64, 0, LLVMDIFlagZero); LLVMMetadataRef Int64TypeDef = LLVMDIBuilderCreateTypedef(DIB, Int64Ty, "int64_t", 7, File, 42, File);