Index: bindings/go/llvm/dibuilder.go =================================================================== --- bindings/go/llvm/dibuilder.go +++ bindings/go/llvm/dibuilder.go @@ -41,6 +41,7 @@ ) const ( + FlagZero = 0 FlagPrivate = 1 << iota FlagProtected FlagFwdDecl @@ -299,6 +300,7 @@ C.size_t(len(t.Name)), C.uint64_t(t.SizeInBits), C.unsigned(t.Encoding), + C.LLVMDIFlags(FlagZero), ) return Metadata{C: result} } Index: include/llvm-c/DebugInfo.h =================================================================== --- include/llvm-c/DebugInfo.h +++ include/llvm-c/DebugInfo.h @@ -57,6 +57,8 @@ 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 @@ * \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. Index: lib/IR/DebugInfo.cpp =================================================================== --- lib/IR/DebugInfo.cpp +++ lib/IR/DebugInfo.cpp @@ -948,9 +948,11 @@ 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( Index: tools/llvm-c-test/debuginfo.c =================================================================== --- tools/llvm-c-test/debuginfo.c +++ tools/llvm-c-test/debuginfo.c @@ -68,7 +68,7 @@ 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);