Lines Matching refs:TI
177 const TargetInfo &TI, MacroBuilder &Builder) {
178 DefineTypeSize(MacroName, TI.getTypeWidth(Ty), TI.getTypeConstantSuffix(Ty),
179 TI.isTypeSigned(Ty), Builder);
183 const TargetInfo &TI, MacroBuilder &Builder) {
184 bool IsSigned = TI.isTypeSigned(Ty);
185 StringRef FmtModifier = TI.getTypeFormatModifier(Ty);
198 const TargetInfo &TI, MacroBuilder &Builder) {
199 Builder.defineMacro(MacroName, Twine(TI.getTypeWidth(Ty)));
203 const TargetInfo &TI, MacroBuilder &Builder) {
205 Twine(BitWidth / TI.getCharWidth()));
209 const TargetInfo &TI,
211 int TypeWidth = TI.getTypeWidth(Ty);
212 bool IsSigned = TI.isTypeSigned(Ty);
217 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type();
222 Ty = IsSigned ? TI.getInt16Type() : TI.getUInt16Type();
227 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);
229 StringRef ConstSuffix(TI.getTypeConstantSuffix(Ty));
234 const TargetInfo &TI,
236 int TypeWidth = TI.getTypeWidth(Ty);
237 bool IsSigned = TI.isTypeSigned(Ty);
242 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type();
245 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
249 const TargetInfo &TI,
251 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
257 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
258 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);
262 const TargetInfo &TI, MacroBuilder &Builder) {
265 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
271 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
273 DefineFmt(Prefix + Twine(TypeWidth), Ty, TI, Builder);
348 static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
412 Twine(TI.getNewAlign() / TI.getCharWidth()) +
413 TI.getTypeConstantSuffix(TI.getSizeType()));
475 if (TI.isLittleEndian())
613 void InitializeOpenCLFeatureTestMacros(const TargetInfo &TI,
616 const llvm::StringMap<bool> &OpenCLFeaturesMap = TI.getSupportedOpenCLOpts();
622 if (TI.hasFeatureEnabled(OpenCLFeaturesMap, Name) &&
634 static void InitializePredefinedMacros(const TargetInfo &TI,
763 Twine(TI.useSignedCharForObjCBool() ? "0" : "1"));
794 (TI.getTriple().isThumb() || TI.getTriple().isARM()))
815 if (TI.getTypeWidth(TI.getWCharType()) >= 32) {
844 if (TI.isBigEndian()) {
852 if (TI.getPointerWidth(0) == 64 && TI.getLongWidth() == 64
853 && TI.getIntWidth() == 32) {
858 if (TI.getPointerWidth(0) == 32 && TI.getLongWidth() == 32
859 && TI.getIntWidth() == 32) {
865 assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far");
866 Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth()));
868 DefineTypeSize("__SCHAR_MAX__", TargetInfo::SignedChar, TI, Builder);
869 DefineTypeSize("__SHRT_MAX__", TargetInfo::SignedShort, TI, Builder);
870 DefineTypeSize("__INT_MAX__", TargetInfo::SignedInt, TI, Builder);
871 DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder);
872 DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder);
873 DefineTypeSize("__WCHAR_MAX__", TI.getWCharType(), TI, Builder);
874 DefineTypeSize("__WINT_MAX__", TI.getWIntType(), TI, Builder);
875 DefineTypeSize("__INTMAX_MAX__", TI.getIntMaxType(), TI, Builder);
876 DefineTypeSize("__SIZE_MAX__", TI.getSizeType(), TI, Builder);
878 DefineTypeSize("__UINTMAX_MAX__", TI.getUIntMaxType(), TI, Builder);
879 DefineTypeSize("__PTRDIFF_MAX__", TI.getPtrDiffType(0), TI, Builder);
880 DefineTypeSize("__INTPTR_MAX__", TI.getIntPtrType(), TI, Builder);
881 DefineTypeSize("__UINTPTR_MAX__", TI.getUIntPtrType(), TI, Builder);
883 DefineTypeSizeof("__SIZEOF_DOUBLE__", TI.getDoubleWidth(), TI, Builder);
884 DefineTypeSizeof("__SIZEOF_FLOAT__", TI.getFloatWidth(), TI, Builder);
885 DefineTypeSizeof("__SIZEOF_INT__", TI.getIntWidth(), TI, Builder);
886 DefineTypeSizeof("__SIZEOF_LONG__", TI.getLongWidth(), TI, Builder);
887 DefineTypeSizeof("__SIZEOF_LONG_DOUBLE__",TI.getLongDoubleWidth(),TI,Builder);
888 DefineTypeSizeof("__SIZEOF_LONG_LONG__", TI.getLongLongWidth(), TI, Builder);
889 DefineTypeSizeof("__SIZEOF_POINTER__", TI.getPointerWidth(0), TI, Builder);
890 DefineTypeSizeof("__SIZEOF_SHORT__", TI.getShortWidth(), TI, Builder);
892 TI.getTypeWidth(TI.getPtrDiffType(0)), TI, Builder);
894 TI.getTypeWidth(TI.getSizeType()), TI, Builder);
896 TI.getTypeWidth(TI.getWCharType()), TI, Builder);
898 TI.getTypeWidth(TI.getWIntType()), TI, Builder);
899 if (TI.hasInt128Type())
900 DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
902 DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
903 DefineFmt("__INTMAX", TI.getIntMaxType(), TI, Builder);
905 TI.getTypeConstantSuffix(TI.getIntMaxType()));
906 DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder);
907 DefineFmt("__UINTMAX", TI.getUIntMaxType(), TI, Builder);
909 TI.getTypeConstantSuffix(TI.getUIntMaxType()));
910 DefineTypeWidth("__INTMAX_WIDTH__", TI.getIntMaxType(), TI, Builder);
911 DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(0), Builder);
912 DefineFmt("__PTRDIFF", TI.getPtrDiffType(0), TI, Builder);
913 DefineTypeWidth("__PTRDIFF_WIDTH__", TI.getPtrDiffType(0), TI, Builder);
914 DefineType("__INTPTR_TYPE__", TI.getIntPtrType(), Builder);
915 DefineFmt("__INTPTR", TI.getIntPtrType(), TI, Builder);
916 DefineTypeWidth("__INTPTR_WIDTH__", TI.getIntPtrType(), TI, Builder);
917 DefineType("__SIZE_TYPE__", TI.getSizeType(), Builder);
918 DefineFmt("__SIZE", TI.getSizeType(), TI, Builder);
919 DefineTypeWidth("__SIZE_WIDTH__", TI.getSizeType(), TI, Builder);
920 DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder);
921 DefineTypeWidth("__WCHAR_WIDTH__", TI.getWCharType(), TI, Builder);
922 DefineType("__WINT_TYPE__", TI.getWIntType(), Builder);
923 DefineTypeWidth("__WINT_WIDTH__", TI.getWIntType(), TI, Builder);
924 DefineTypeWidth("__SIG_ATOMIC_WIDTH__", TI.getSigAtomicType(), TI, Builder);
925 DefineTypeSize("__SIG_ATOMIC_MAX__", TI.getSigAtomicType(), TI, Builder);
926 DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder);
927 DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder);
929 DefineTypeWidth("__UINTMAX_WIDTH__", TI.getUIntMaxType(), TI, Builder);
930 DefineType("__UINTPTR_TYPE__", TI.getUIntPtrType(), Builder);
931 DefineFmt("__UINTPTR", TI.getUIntPtrType(), TI, Builder);
932 DefineTypeWidth("__UINTPTR_WIDTH__", TI.getUIntPtrType(), TI, Builder);
934 if (TI.hasFloat16Type())
935 DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16");
936 DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
937 DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
938 DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
942 Twine((int)TI.getPointerWidth(0)));
946 Twine(TI.getSuitableAlign() / TI.getCharWidth()) );
951 if (!TargetInfo::isTypeSigned(TI.getWCharType()))
954 if (!TargetInfo::isTypeSigned(TI.getWIntType()))
958 DefineExactWidthIntType(TargetInfo::SignedChar, TI, Builder);
960 if (TI.getShortWidth() > TI.getCharWidth())
961 DefineExactWidthIntType(TargetInfo::SignedShort, TI, Builder);
963 if (TI.getIntWidth() > TI.getShortWidth())
964 DefineExactWidthIntType(TargetInfo::SignedInt, TI, Builder);
966 if (TI.getLongWidth() > TI.getIntWidth())
967 DefineExactWidthIntType(TargetInfo::SignedLong, TI, Builder);
969 if (TI.getLongLongWidth() > TI.getLongWidth())
970 DefineExactWidthIntType(TargetInfo::SignedLongLong, TI, Builder);
972 DefineExactWidthIntType(TargetInfo::UnsignedChar, TI, Builder);
973 DefineExactWidthIntTypeSize(TargetInfo::UnsignedChar, TI, Builder);
974 DefineExactWidthIntTypeSize(TargetInfo::SignedChar, TI, Builder);
976 if (TI.getShortWidth() > TI.getCharWidth()) {
977 DefineExactWidthIntType(TargetInfo::UnsignedShort, TI, Builder);
978 DefineExactWidthIntTypeSize(TargetInfo::UnsignedShort, TI, Builder);
979 DefineExactWidthIntTypeSize(TargetInfo::SignedShort, TI, Builder);
982 if (TI.getIntWidth() > TI.getShortWidth()) {
983 DefineExactWidthIntType(TargetInfo::UnsignedInt, TI, Builder);
984 DefineExactWidthIntTypeSize(TargetInfo::UnsignedInt, TI, Builder);
985 DefineExactWidthIntTypeSize(TargetInfo::SignedInt, TI, Builder);
988 if (TI.getLongWidth() > TI.getIntWidth()) {
989 DefineExactWidthIntType(TargetInfo::UnsignedLong, TI, Builder);
990 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLong, TI, Builder);
991 DefineExactWidthIntTypeSize(TargetInfo::SignedLong, TI, Builder);
994 if (TI.getLongLongWidth() > TI.getLongWidth()) {
995 DefineExactWidthIntType(TargetInfo::UnsignedLongLong, TI, Builder);
996 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLongLong, TI, Builder);
997 DefineExactWidthIntTypeSize(TargetInfo::SignedLongLong, TI, Builder);
1000 DefineLeastWidthIntType(8, true, TI, Builder);
1001 DefineLeastWidthIntType(8, false, TI, Builder);
1002 DefineLeastWidthIntType(16, true, TI, Builder);
1003 DefineLeastWidthIntType(16, false, TI, Builder);
1004 DefineLeastWidthIntType(32, true, TI, Builder);
1005 DefineLeastWidthIntType(32, false, TI, Builder);
1006 DefineLeastWidthIntType(64, true, TI, Builder);
1007 DefineLeastWidthIntType(64, false, TI, Builder);
1009 DefineFastIntType(8, true, TI, Builder);
1010 DefineFastIntType(8, false, TI, Builder);
1011 DefineFastIntType(16, true, TI, Builder);
1012 DefineFastIntType(16, false, TI, Builder);
1013 DefineFastIntType(32, true, TI, Builder);
1014 DefineFastIntType(32, false, TI, Builder);
1015 DefineFastIntType(64, true, TI, Builder);
1016 DefineFastIntType(64, false, TI, Builder);
1018 Builder.defineMacro("__USER_LABEL_PREFIX__", TI.getUserLabelPrefix());
1038 unsigned InlineWidthBits = TI.getMaxAtomicInlineWidth();
1041 getLockFreeValue(TI.get##Type##Width(), \
1042 TI.get##Type##Align(), \
1056 getLockFreeValue(TI.getPointerWidth(0),
1057 TI.getPointerAlign(0),
1078 Builder.defineMacro("__FLT_EVAL_METHOD__", Twine(TI.getFloatEvalMethod()));
1112 if (TI.getTriple().isOSDarwin()) {
1120 if (TI.getTriple().isOSDarwin() && TI.getTriple().isSimulatorEnvironment())
1170 InitializeOpenCLFeatureTestMacros(TI, LangOpts, Builder);
1172 if (TI.getTriple().isSPIR())
1176 if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
1185 TI.getTargetDefines(LangOpts, Builder);