llvm.org GIT mirror llvm / cb99414
[LLVM-C] Miscellaneous Cleanups in DIBuilder Bindings Summary: * rL328953 does not include bindings for LLVMDIBuilderCreateClassType and LLVMDIBuilderCreateBitFieldMemberType despite declaring their prototypes. Provide these bindings now. * Switch to more precise types with specific numeric limits matching the DIBuilder's C++ API. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46168 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331114 91177308-0d34-0410-b5e6-96231b3b80d8 Robert Widmann 1 year, 4 months ago
2 changed file(s) with 94 addition(s) and 49 deletion(s). Raw diff Collapse all Expand all
361361 LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
362362 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
363363 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
364 unsigned SizeInBits, unsigned AlignInBits, LLVMMetadataRef *Elements,
364 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
365365 unsigned NumElements, LLVMMetadataRef ClassTy);
366366
367367 /**
384384 LLVMMetadataRef LLVMDIBuilderCreateUnionType(
385385 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
386386 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
387 unsigned SizeInBits, unsigned AlignInBits, LLVMDIFlags Flags,
387 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
388388 LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
389389 const char *UniqueId, size_t UniqueIdLen);
390390
399399 * \param NumSubscripts Number of subscripts.
400400 */
401401 LLVMMetadataRef
402 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, unsigned Size,
403 unsigned AlignInBits, LLVMMetadataRef Ty,
402 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
403 uint32_t AlignInBits, LLVMMetadataRef Ty,
404404 LLVMMetadataRef *Subscripts,
405405 unsigned NumSubscripts);
406406
414414 * \param NumSubscripts Number of subscripts.
415415 */
416416 LLVMMetadataRef
417 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, unsigned Size,
418 unsigned AlignInBits, LLVMMetadataRef Ty,
417 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
418 uint32_t AlignInBits, LLVMMetadataRef Ty,
419419 LLVMMetadataRef *Subscripts,
420420 unsigned NumSubscripts);
421421
440440 */
441441 LLVMMetadataRef
442442 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
443 size_t NameLen, unsigned SizeInBits,
443 size_t NameLen, uint64_t SizeInBits,
444444 LLVMDWARFTypeEncoding Encoding);
445445
446446 /**
455455 */
456456 LLVMMetadataRef LLVMDIBuilderCreatePointerType(
457457 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
458 unsigned SizeInBits, unsigned AlignInBits, unsigned AddressSpace,
458 uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
459459 const char *Name, size_t NameLen);
460460
461461 /**
479479 LLVMMetadataRef LLVMDIBuilderCreateStructType(
480480 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
481481 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
482 unsigned SizeInBits, unsigned AlignInBits, LLVMDIFlags Flags,
482 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
483483 LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
484484 unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
485485 const char *UniqueId, size_t UniqueIdLen);
501501 LLVMMetadataRef LLVMDIBuilderCreateMemberType(
502502 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
503503 size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
504 unsigned SizeInBits, unsigned AlignInBits, unsigned OffsetInBits,
504 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
505505 LLVMDIFlags Flags, LLVMMetadataRef Ty);
506506
507507 /**
523523 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
524524 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
525525 LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
526 unsigned AlignInBits);
526 uint32_t AlignInBits);
527527
528528 /**
529529 * Create debugging information entry for a pointer to member.
538538 LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
539539 LLVMMetadataRef PointeeType,
540540 LLVMMetadataRef ClassType,
541 unsigned SizeInBits,
542 unsigned AlignInBits,
541 uint64_t SizeInBits,
542 uint32_t AlignInBits,
543543 LLVMDIFlags Flags);
544544
545545 /**
601601 LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
602602 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
603603 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
604 unsigned RuntimeLang, unsigned SizeInBits, unsigned AlignInBits,
604 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
605605 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
606606
607607 /**
625625 LLVMDIBuilderCreateReplaceableCompositeType(
626626 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
627627 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
628 unsigned RuntimeLang, unsigned SizeInBits, unsigned AlignInBits,
628 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
629629 LLVMDIFlags Flags, const char *UniqueIdentifier,
630630 size_t UniqueIdentifierLen);
631631
648648 LLVMMetadataRef Scope,
649649 const char *Name, size_t NameLen,
650650 LLVMMetadataRef File, unsigned LineNumber,
651 unsigned SizeInBits,
652 unsigned OffsetInBits,
653 unsigned StorageOffsetInBits,
651 uint64_t SizeInBits,
652 uint64_t OffsetInBits,
653 uint64_t StorageOffsetInBits,
654654 LLVMDIFlags Flags, LLVMMetadataRef Type);
655655
656656 /**
657657 * Create debugging information entry for a class.
658 * \param Scope Scope in which this class is defined.
659 * \param Name class name.
660 * \param File File where this member is defined.
661 * \param LineNumber Line number.
662 * \param SizeInBits Member size.
663 * \param AlignInBits Member alignment.
664 * \param OffsetInBits Member offset.
665 * \param Flags Flags to encode member attribute, e.g. private
666 * \param Elements class members.
667 * \param NumElements Number of class elements.
668 * \param DerivedFrom Debug info of the base class of this type.
669 * \param TemplateParamsNode Template type parameters.
658 * \param Scope Scope in which this class is defined.
659 * \param Name Class name.
660 * \param NameLen The length of the C string passed to \c Name.
661 * \param File File where this member is defined.
662 * \param LineNumber Line number.
663 * \param SizeInBits Member size.
664 * \param AlignInBits Member alignment.
665 * \param OffsetInBits Member offset.
666 * \param Flags Flags to encode member attribute, e.g. private.
667 * \param DerivedFrom Debug info of the base class of this type.
668 * \param Elements Class members.
669 * \param NumElements Number of class elements.
670 * \param VTableHolder Debug info of the base class that contains vtable
671 * for this type. This is used in
672 * DW_AT_containing_type. See DWARF documentation
673 * for more info.
674 * \param TemplateParamsNode Template type parameters.
675 * \param UniqueIdentifier A unique identifier for the type.
676 * \param UniqueIdentifierLen Length of the unique identifier.
670677 */
671678 LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
672679 LLVMMetadataRef Scope, const char *Name, size_t NameLen,
673 LLVMMetadataRef File, unsigned LineNumber, unsigned SizeInBits,
674 unsigned AlignInBits, unsigned OffsetInBits, LLVMDIFlags Flags,
680 LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
681 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
682 LLVMMetadataRef DerivedFrom,
675683 LLVMMetadataRef *Elements, unsigned NumElements,
676 LLVMMetadataRef DerivedFrom, LLVMMetadataRef TemplateParamsNode);
684 LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
685 const char *UniqueIdentifier, size_t UniqueIdentifierLen);
677686
678687 /**
679688 * Create a new DIType* with "artificial" flag set.
838838 LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
839839 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
840840 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
841 unsigned SizeInBits, unsigned AlignInBits, LLVMMetadataRef *Elements,
841 uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
842842 unsigned NumElements, LLVMMetadataRef ClassTy) {
843843 auto Elts = unwrap(Builder)->getOrCreateArray({unwrap(Elements),
844844 NumElements});
850850 LLVMMetadataRef LLVMDIBuilderCreateUnionType(
851851 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
852852 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
853 unsigned SizeInBits, unsigned AlignInBits, LLVMDIFlags Flags,
853 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
854854 LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang,
855855 const char *UniqueId, size_t UniqueIdLen) {
856856 auto Elts = unwrap(Builder)->getOrCreateArray({unwrap(Elements),
863863
864864
865865 LLVMMetadataRef
866 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, unsigned Size,
867 unsigned AlignInBits, LLVMMetadataRef Ty,
866 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
867 uint32_t AlignInBits, LLVMMetadataRef Ty,
868868 LLVMMetadataRef *Subscripts,
869869 unsigned NumSubscripts) {
870870 auto Subs = unwrap(Builder)->getOrCreateArray({unwrap(Subscripts),
874874 }
875875
876876 LLVMMetadataRef
877 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, unsigned Size,
878 unsigned AlignInBits, LLVMMetadataRef Ty,
877 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
878 uint32_t AlignInBits, LLVMMetadataRef Ty,
879879 LLVMMetadataRef *Subscripts,
880880 unsigned NumSubscripts) {
881881 auto Subs = unwrap(Builder)->getOrCreateArray({unwrap(Subscripts),
886886
887887 LLVMMetadataRef
888888 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
889 size_t NameLen, unsigned SizeInBits,
889 size_t NameLen, uint64_t SizeInBits,
890890 LLVMDWARFTypeEncoding Encoding) {
891891 return wrap(unwrap(Builder)->createBasicType({Name, NameLen},
892892 SizeInBits, Encoding));
894894
895895 LLVMMetadataRef LLVMDIBuilderCreatePointerType(
896896 LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
897 unsigned SizeInBits, unsigned AlignInBits, unsigned AddressSpace,
897 uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
898898 const char *Name, size_t NameLen) {
899899 return wrap(unwrap(Builder)->createPointerType(unwrapDI(PointeeTy),
900900 SizeInBits, AlignInBits,
904904 LLVMMetadataRef LLVMDIBuilderCreateStructType(
905905 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
906906 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
907 unsigned SizeInBits, unsigned AlignInBits, LLVMDIFlags Flags,
907 uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
908908 LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements,
909909 unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
910910 const char *UniqueId, size_t UniqueIdLen) {
919919
920920 LLVMMetadataRef LLVMDIBuilderCreateMemberType(
921921 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
922 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, unsigned SizeInBits,
923 unsigned AlignInBits, unsigned OffsetInBits, LLVMDIFlags Flags,
922 size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
923 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
924924 LLVMMetadataRef Ty) {
925925 return wrap(unwrap(Builder)->createMemberType(unwrapDI(Scope),
926926 {Name, NameLen}, unwrapDI(File), LineNo, SizeInBits, AlignInBits,
938938 LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
939939 size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
940940 LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal,
941 unsigned AlignInBits) {
941 uint32_t AlignInBits) {
942942 return wrap(unwrap(Builder)->createStaticMemberType(
943943 unwrapDI(Scope), {Name, NameLen},
944944 unwrapDI(File), LineNumber, unwrapDI(Type),
956956 LLVMDIBuilderCreateForwardDecl(
957957 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
958958 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
959 unsigned RuntimeLang, unsigned SizeInBits, unsigned AlignInBits,
959 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
960960 const char *UniqueIdentifier, size_t UniqueIdentifierLen) {
961961 return wrap(unwrap(Builder)->createForwardDecl(
962962 Tag, {Name, NameLen}, unwrapDI(Scope),
968968 LLVMDIBuilderCreateReplaceableCompositeType(
969969 LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
970970 size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
971 unsigned RuntimeLang, unsigned SizeInBits, unsigned AlignInBits,
971 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
972972 LLVMDIFlags Flags, const char *UniqueIdentifier,
973973 size_t UniqueIdentifierLen) {
974974 return wrap(unwrap(Builder)->createReplaceableCompositeType(
10011001 LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
10021002 LLVMMetadataRef PointeeType,
10031003 LLVMMetadataRef ClassType,
1004 unsigned SizeInBits,
1005 unsigned AlignInBits,
1004 uint64_t SizeInBits,
1005 uint32_t AlignInBits,
10061006 LLVMDIFlags Flags) {
10071007 return wrap(unwrap(Builder)->createMemberPointerType(
10081008 unwrapDI(PointeeType),
10091009 unwrapDI(ClassType), AlignInBits, SizeInBits,
10101010 map_from_llvmDIFlags(Flags)));
1011 }
1012
1013 LLVMMetadataRef
1014 LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder,
1015 LLVMMetadataRef Scope,
1016 const char *Name, size_t NameLen,
1017 LLVMMetadataRef File, unsigned LineNumber,
1018 uint64_t SizeInBits,
1019 uint64_t OffsetInBits,
1020 uint64_t StorageOffsetInBits,
1021 LLVMDIFlags Flags, LLVMMetadataRef Type) {
1022 return wrap(unwrap(Builder)->createBitFieldMemberType(
1023 unwrapDI(Scope), {Name, NameLen},
1024 unwrapDI(File), LineNumber,
1025 SizeInBits, OffsetInBits, StorageOffsetInBits,
1026 map_from_llvmDIFlags(Flags), unwrapDI(Type)));
1027 }
1028
1029 LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
1030 LLVMMetadataRef Scope, const char *Name, size_t NameLen,
1031 LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
1032 uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
1033 LLVMMetadataRef DerivedFrom,
1034 LLVMMetadataRef *Elements, unsigned NumElements,
1035 LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode,
1036 const char *UniqueIdentifier, size_t UniqueIdentifierLen) {
1037 auto Elts = unwrap(Builder)->getOrCreateArray({unwrap(Elements),
1038 NumElements});
1039 return wrap(unwrap(Builder)->createClassType(
1040 unwrapDI(Scope), {Name, NameLen},
1041 unwrapDI(File), LineNumber,
1042 SizeInBits, AlignInBits, OffsetInBits,
1043 map_from_llvmDIFlags(Flags), unwrapDI(DerivedFrom),
1044 Elts, unwrapDI(VTableHolder),
1045 unwrapDI(TemplateParamsNode),
1046 {UniqueIdentifier, UniqueIdentifierLen}));
10111047 }
10121048
10131049 LLVMMetadataRef