llvm.org GIT mirror llvm / 8bf9e9a
[C-API][DIBuilder] Added DIFlags in LLVMDIBuilderCreateBasicType Added DIFlags in LLVMDIBuilderCreateBasicType to add optional DWARF attributes, such as DW_AT_endianity. Patch by Chirag Patel. Differential Revision: https://reviews.llvm.org/D50832 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340146 91177308-0d34-0410-b5e6-96231b3b80d8 whitequark 1 year, 1 month ago
4 changed file(s) with 11 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
298298 C.size_t(len(t.Name)),
299299 C.uint64_t(t.SizeInBits),
300300 C.unsigned(t.Encoding),
301 C.LLVMDIFlags(0),
301302 )
302303 return Metadata{C: result}
303304 }
5656 LLVMDIFlagFixedEnum = 1 << 24,
5757 LLVMDIFlagThunk = 1 << 25,
5858 LLVMDIFlagTrivial = 1 << 26,
59 LLVMDIFlagBigEndian = 1 << 27,
60 LLVMDIFlagLittleEndian = 1 << 28,
5961 LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
6062 LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected |
6163 LLVMDIFlagPublic,
530532 * \param NameLen Length of type name.
531533 * \param SizeInBits Size of the type.
532534 * \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
535 * \param Flags Flags to encode optional attribute like endianity
533536 */
534537 LLVMMetadataRef
535538 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
536539 size_t NameLen, uint64_t SizeInBits,
537 LLVMDWARFTypeEncoding Encoding);
540 LLVMDWARFTypeEncoding Encoding,
541 LLVMDIFlags Flags);
538542
539543 /**
540544 * Create debugging information entry for a pointer.
947947 LLVMMetadataRef
948948 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
949949 size_t NameLen, uint64_t SizeInBits,
950 LLVMDWARFTypeEncoding Encoding) {
950 LLVMDWARFTypeEncoding Encoding,
951 LLVMDIFlags Flags) {
951952 return wrap(unwrap(Builder)->createBasicType({Name, NameLen},
952 SizeInBits, Encoding));
953 SizeInBits, Encoding,
954 map_from_llvmDIFlags(Flags)));
953955 }
954956
955957 LLVMMetadataRef LLVMDIBuilderCreatePointerType(
6767 NULL, 0);
6868
6969 LLVMMetadataRef Int64Ty =
70 LLVMDIBuilderCreateBasicType(DIB, "Int64", 5, 64, 0);
70 LLVMDIBuilderCreateBasicType(DIB, "Int64", 5, 64, 0, LLVMDIFlagZero);
7171 LLVMMetadataRef Int64TypeDef =
7272 LLVMDIBuilderCreateTypedef(DIB, Int64Ty, "int64_t", 7, File, 42, File);
7373