static void DefineExactWidthIntTypeSize(TargetInfo::IntType Ty, const TargetInfo &TI, MacroBuilder &Builder) { int TypeWidth = TI.getTypeWidth(Ty); bool IsSigned = TI.isTypeSigned(Ty); // Use the target specified int64 type, when appropriate, so that [u]int64_t // ends up being defined in terms of the correct type. if (TypeWidth == 64) Ty = IsSigned ? TI.getInt64Type() : TI.getIntTypeByWidth(64, false); const char *Prefix = IsSigned ? "__INT" : "__UINT"; DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder); }
static void DefineExactWidthIntType(TargetInfo::IntType Ty, const TargetInfo &TI, MacroBuilder &Builder) { int TypeWidth = TI.getTypeWidth(Ty); bool IsSigned = TI.isTypeSigned(Ty); // Use the target specified int64 type, when appropriate, so that [u]int64_t // ends up being defined in terms of the correct type. if (TypeWidth == 64) Ty = IsSigned ? TI.getInt64Type() : TI.getIntTypeByWidth(64, false); const char *Prefix = IsSigned ? "__INT" : "__UINT"; DefineType(Prefix + Twine(TypeWidth) + "_TYPE__", Ty, Builder); StringRef ConstSuffix(TargetInfo::getTypeConstantSuffix(Ty)); if (!ConstSuffix.empty()) Builder.defineMacro(Prefix + Twine(TypeWidth) + "_C_SUFFIX__", ConstSuffix); }