Lines Matching refs:TI
195 const TargetInfo &TI, MacroBuilder &Builder) { in DefineTypeSize() argument
196 DefineTypeSize(MacroName, TI.getTypeWidth(Ty), TI.getTypeConstantSuffix(Ty), in DefineTypeSize()
197 TI.isTypeSigned(Ty), Builder); in DefineTypeSize()
201 const TargetInfo &TI, MacroBuilder &Builder) { in DefineFmt() argument
202 bool IsSigned = TI.isTypeSigned(Ty); in DefineFmt()
203 StringRef FmtModifier = TI.getTypeFormatModifier(Ty); in DefineFmt()
216 const TargetInfo &TI, MacroBuilder &Builder) { in DefineTypeWidth() argument
217 Builder.defineMacro(MacroName, Twine(TI.getTypeWidth(Ty))); in DefineTypeWidth()
221 const TargetInfo &TI, MacroBuilder &Builder) { in DefineTypeSizeof() argument
223 Twine(BitWidth / TI.getCharWidth())); in DefineTypeSizeof()
227 const TargetInfo &TI, in DefineExactWidthIntType() argument
229 int TypeWidth = TI.getTypeWidth(Ty); in DefineExactWidthIntType()
230 bool IsSigned = TI.isTypeSigned(Ty); in DefineExactWidthIntType()
235 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type(); in DefineExactWidthIntType()
240 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder); in DefineExactWidthIntType()
242 StringRef ConstSuffix(TI.getTypeConstantSuffix(Ty)); in DefineExactWidthIntType()
247 const TargetInfo &TI, in DefineExactWidthIntTypeSize() argument
249 int TypeWidth = TI.getTypeWidth(Ty); in DefineExactWidthIntTypeSize()
250 bool IsSigned = TI.isTypeSigned(Ty); in DefineExactWidthIntTypeSize()
255 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type(); in DefineExactWidthIntTypeSize()
258 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder); in DefineExactWidthIntTypeSize()
262 const TargetInfo &TI, in DefineLeastWidthIntType() argument
264 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned); in DefineLeastWidthIntType()
270 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder); in DefineLeastWidthIntType()
271 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder); in DefineLeastWidthIntType()
275 const TargetInfo &TI, MacroBuilder &Builder) { in DefineFastIntType() argument
278 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned); in DefineFastIntType()
284 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder); in DefineFastIntType()
286 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder); in DefineFastIntType()
361 static void InitializeStandardPredefinedMacros(const TargetInfo &TI, in InitializeStandardPredefinedMacros() argument
503 static void InitializePredefinedMacros(const TargetInfo &TI, in InitializePredefinedMacros() argument
658 if (TI.isBigEndian()) { in InitializePredefinedMacros()
666 if (TI.getPointerWidth(0) == 64 && TI.getLongWidth() == 64 in InitializePredefinedMacros()
667 && TI.getIntWidth() == 32) { in InitializePredefinedMacros()
672 if (TI.getPointerWidth(0) == 32 && TI.getLongWidth() == 32 in InitializePredefinedMacros()
673 && TI.getIntWidth() == 32) { in InitializePredefinedMacros()
679 assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); in InitializePredefinedMacros()
682 DefineTypeSize("__SCHAR_MAX__", TargetInfo::SignedChar, TI, Builder); in InitializePredefinedMacros()
683 DefineTypeSize("__SHRT_MAX__", TargetInfo::SignedShort, TI, Builder); in InitializePredefinedMacros()
684 DefineTypeSize("__INT_MAX__", TargetInfo::SignedInt, TI, Builder); in InitializePredefinedMacros()
685 DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder); in InitializePredefinedMacros()
686 DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder); in InitializePredefinedMacros()
687 DefineTypeSize("__WCHAR_MAX__", TI.getWCharType(), TI, Builder); in InitializePredefinedMacros()
688 DefineTypeSize("__INTMAX_MAX__", TI.getIntMaxType(), TI, Builder); in InitializePredefinedMacros()
689 DefineTypeSize("__SIZE_MAX__", TI.getSizeType(), TI, Builder); in InitializePredefinedMacros()
691 DefineTypeSize("__UINTMAX_MAX__", TI.getUIntMaxType(), TI, Builder); in InitializePredefinedMacros()
692 DefineTypeSize("__PTRDIFF_MAX__", TI.getPtrDiffType(0), TI, Builder); in InitializePredefinedMacros()
693 DefineTypeSize("__INTPTR_MAX__", TI.getIntPtrType(), TI, Builder); in InitializePredefinedMacros()
694 DefineTypeSize("__UINTPTR_MAX__", TI.getUIntPtrType(), TI, Builder); in InitializePredefinedMacros()
696 DefineTypeSizeof("__SIZEOF_DOUBLE__", TI.getDoubleWidth(), TI, Builder); in InitializePredefinedMacros()
697 DefineTypeSizeof("__SIZEOF_FLOAT__", TI.getFloatWidth(), TI, Builder); in InitializePredefinedMacros()
698 DefineTypeSizeof("__SIZEOF_INT__", TI.getIntWidth(), TI, Builder); in InitializePredefinedMacros()
699 DefineTypeSizeof("__SIZEOF_LONG__", TI.getLongWidth(), TI, Builder); in InitializePredefinedMacros()
700 DefineTypeSizeof("__SIZEOF_LONG_DOUBLE__",TI.getLongDoubleWidth(),TI,Builder); in InitializePredefinedMacros()
701 DefineTypeSizeof("__SIZEOF_LONG_LONG__", TI.getLongLongWidth(), TI, Builder); in InitializePredefinedMacros()
702 DefineTypeSizeof("__SIZEOF_POINTER__", TI.getPointerWidth(0), TI, Builder); in InitializePredefinedMacros()
703 DefineTypeSizeof("__SIZEOF_SHORT__", TI.getShortWidth(), TI, Builder); in InitializePredefinedMacros()
705 TI.getTypeWidth(TI.getPtrDiffType(0)), TI, Builder); in InitializePredefinedMacros()
707 TI.getTypeWidth(TI.getSizeType()), TI, Builder); in InitializePredefinedMacros()
709 TI.getTypeWidth(TI.getWCharType()), TI, Builder); in InitializePredefinedMacros()
711 TI.getTypeWidth(TI.getWIntType()), TI, Builder); in InitializePredefinedMacros()
712 if (TI.hasInt128Type()) in InitializePredefinedMacros()
713 DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder); in InitializePredefinedMacros()
715 DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder); in InitializePredefinedMacros()
716 DefineFmt("__INTMAX", TI.getIntMaxType(), TI, Builder); in InitializePredefinedMacros()
718 TI.getTypeConstantSuffix(TI.getIntMaxType())); in InitializePredefinedMacros()
719 DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder); in InitializePredefinedMacros()
720 DefineFmt("__UINTMAX", TI.getUIntMaxType(), TI, Builder); in InitializePredefinedMacros()
722 TI.getTypeConstantSuffix(TI.getUIntMaxType())); in InitializePredefinedMacros()
723 DefineTypeWidth("__INTMAX_WIDTH__", TI.getIntMaxType(), TI, Builder); in InitializePredefinedMacros()
724 DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(0), Builder); in InitializePredefinedMacros()
725 DefineFmt("__PTRDIFF", TI.getPtrDiffType(0), TI, Builder); in InitializePredefinedMacros()
726 DefineTypeWidth("__PTRDIFF_WIDTH__", TI.getPtrDiffType(0), TI, Builder); in InitializePredefinedMacros()
727 DefineType("__INTPTR_TYPE__", TI.getIntPtrType(), Builder); in InitializePredefinedMacros()
728 DefineFmt("__INTPTR", TI.getIntPtrType(), TI, Builder); in InitializePredefinedMacros()
729 DefineTypeWidth("__INTPTR_WIDTH__", TI.getIntPtrType(), TI, Builder); in InitializePredefinedMacros()
730 DefineType("__SIZE_TYPE__", TI.getSizeType(), Builder); in InitializePredefinedMacros()
731 DefineFmt("__SIZE", TI.getSizeType(), TI, Builder); in InitializePredefinedMacros()
732 DefineTypeWidth("__SIZE_WIDTH__", TI.getSizeType(), TI, Builder); in InitializePredefinedMacros()
733 DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder); in InitializePredefinedMacros()
734 DefineTypeWidth("__WCHAR_WIDTH__", TI.getWCharType(), TI, Builder); in InitializePredefinedMacros()
735 DefineType("__WINT_TYPE__", TI.getWIntType(), Builder); in InitializePredefinedMacros()
736 DefineTypeWidth("__WINT_WIDTH__", TI.getWIntType(), TI, Builder); in InitializePredefinedMacros()
737 DefineTypeWidth("__SIG_ATOMIC_WIDTH__", TI.getSigAtomicType(), TI, Builder); in InitializePredefinedMacros()
738 DefineTypeSize("__SIG_ATOMIC_MAX__", TI.getSigAtomicType(), TI, Builder); in InitializePredefinedMacros()
739 DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder); in InitializePredefinedMacros()
740 DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder); in InitializePredefinedMacros()
742 DefineTypeWidth("__UINTMAX_WIDTH__", TI.getUIntMaxType(), TI, Builder); in InitializePredefinedMacros()
743 DefineType("__UINTPTR_TYPE__", TI.getUIntPtrType(), Builder); in InitializePredefinedMacros()
744 DefineFmt("__UINTPTR", TI.getUIntPtrType(), TI, Builder); in InitializePredefinedMacros()
745 DefineTypeWidth("__UINTPTR_WIDTH__", TI.getUIntPtrType(), TI, Builder); in InitializePredefinedMacros()
747 DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F"); in InitializePredefinedMacros()
748 DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), ""); in InitializePredefinedMacros()
749 DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L"); in InitializePredefinedMacros()
753 Twine((int)TI.getPointerWidth(0))); in InitializePredefinedMacros()
757 Twine(TI.getSuitableAlign() / TI.getCharWidth()) ); in InitializePredefinedMacros()
762 if (!TargetInfo::isTypeSigned(TI.getWCharType())) in InitializePredefinedMacros()
765 if (!TargetInfo::isTypeSigned(TI.getWIntType())) in InitializePredefinedMacros()
769 DefineExactWidthIntType(TargetInfo::SignedChar, TI, Builder); in InitializePredefinedMacros()
771 if (TI.getShortWidth() > TI.getCharWidth()) in InitializePredefinedMacros()
772 DefineExactWidthIntType(TargetInfo::SignedShort, TI, Builder); in InitializePredefinedMacros()
774 if (TI.getIntWidth() > TI.getShortWidth()) in InitializePredefinedMacros()
775 DefineExactWidthIntType(TargetInfo::SignedInt, TI, Builder); in InitializePredefinedMacros()
777 if (TI.getLongWidth() > TI.getIntWidth()) in InitializePredefinedMacros()
778 DefineExactWidthIntType(TargetInfo::SignedLong, TI, Builder); in InitializePredefinedMacros()
780 if (TI.getLongLongWidth() > TI.getLongWidth()) in InitializePredefinedMacros()
781 DefineExactWidthIntType(TargetInfo::SignedLongLong, TI, Builder); in InitializePredefinedMacros()
783 DefineExactWidthIntType(TargetInfo::UnsignedChar, TI, Builder); in InitializePredefinedMacros()
784 DefineExactWidthIntTypeSize(TargetInfo::UnsignedChar, TI, Builder); in InitializePredefinedMacros()
785 DefineExactWidthIntTypeSize(TargetInfo::SignedChar, TI, Builder); in InitializePredefinedMacros()
787 if (TI.getShortWidth() > TI.getCharWidth()) { in InitializePredefinedMacros()
788 DefineExactWidthIntType(TargetInfo::UnsignedShort, TI, Builder); in InitializePredefinedMacros()
789 DefineExactWidthIntTypeSize(TargetInfo::UnsignedShort, TI, Builder); in InitializePredefinedMacros()
790 DefineExactWidthIntTypeSize(TargetInfo::SignedShort, TI, Builder); in InitializePredefinedMacros()
793 if (TI.getIntWidth() > TI.getShortWidth()) { in InitializePredefinedMacros()
794 DefineExactWidthIntType(TargetInfo::UnsignedInt, TI, Builder); in InitializePredefinedMacros()
795 DefineExactWidthIntTypeSize(TargetInfo::UnsignedInt, TI, Builder); in InitializePredefinedMacros()
796 DefineExactWidthIntTypeSize(TargetInfo::SignedInt, TI, Builder); in InitializePredefinedMacros()
799 if (TI.getLongWidth() > TI.getIntWidth()) { in InitializePredefinedMacros()
800 DefineExactWidthIntType(TargetInfo::UnsignedLong, TI, Builder); in InitializePredefinedMacros()
801 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLong, TI, Builder); in InitializePredefinedMacros()
802 DefineExactWidthIntTypeSize(TargetInfo::SignedLong, TI, Builder); in InitializePredefinedMacros()
805 if (TI.getLongLongWidth() > TI.getLongWidth()) { in InitializePredefinedMacros()
806 DefineExactWidthIntType(TargetInfo::UnsignedLongLong, TI, Builder); in InitializePredefinedMacros()
807 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLongLong, TI, Builder); in InitializePredefinedMacros()
808 DefineExactWidthIntTypeSize(TargetInfo::SignedLongLong, TI, Builder); in InitializePredefinedMacros()
811 DefineLeastWidthIntType(8, true, TI, Builder); in InitializePredefinedMacros()
812 DefineLeastWidthIntType(8, false, TI, Builder); in InitializePredefinedMacros()
813 DefineLeastWidthIntType(16, true, TI, Builder); in InitializePredefinedMacros()
814 DefineLeastWidthIntType(16, false, TI, Builder); in InitializePredefinedMacros()
815 DefineLeastWidthIntType(32, true, TI, Builder); in InitializePredefinedMacros()
816 DefineLeastWidthIntType(32, false, TI, Builder); in InitializePredefinedMacros()
817 DefineLeastWidthIntType(64, true, TI, Builder); in InitializePredefinedMacros()
818 DefineLeastWidthIntType(64, false, TI, Builder); in InitializePredefinedMacros()
820 DefineFastIntType(8, true, TI, Builder); in InitializePredefinedMacros()
821 DefineFastIntType(8, false, TI, Builder); in InitializePredefinedMacros()
822 DefineFastIntType(16, true, TI, Builder); in InitializePredefinedMacros()
823 DefineFastIntType(16, false, TI, Builder); in InitializePredefinedMacros()
824 DefineFastIntType(32, true, TI, Builder); in InitializePredefinedMacros()
825 DefineFastIntType(32, false, TI, Builder); in InitializePredefinedMacros()
826 DefineFastIntType(64, true, TI, Builder); in InitializePredefinedMacros()
827 DefineFastIntType(64, false, TI, Builder); in InitializePredefinedMacros()
829 char UserLabelPrefix[2] = {TI.getDataLayout().getGlobalPrefix(), 0}; in InitializePredefinedMacros()
848 unsigned InlineWidthBits = TI.getMaxAtomicInlineWidth(); in InitializePredefinedMacros()
851 getLockFreeValue(TI.get##Type##Width(), \ in InitializePredefinedMacros()
852 TI.get##Type##Align(), \ in InitializePredefinedMacros()
864 getLockFreeValue(TI.getPointerWidth(0), in InitializePredefinedMacros()
865 TI.getPointerAlign(0), in InitializePredefinedMacros()
883 Builder.defineMacro("__FLT_EVAL_METHOD__", Twine(TI.getFloatEvalMethod())); in InitializePredefinedMacros()
918 if (TI.getTriple().isOSDarwin()) { in InitializePredefinedMacros()
961 if (TI.getSupportedOpenCLOpts().is_##Ext##_supported( \ in InitializePredefinedMacros()
968 TI.getTargetDefines(LangOpts, Builder); in InitializePredefinedMacros()