diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2009-11-16 16:36:33 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2009-11-16 16:36:33 +0000 |
commit | eef22efce8dd9d0ba9adb8f4746b96b584f2521d (patch) | |
tree | 17f9314ebafbab333ff66c3941e2c2c37865af9f /lib/Frontend | |
parent | eac73e5b3eb3862945bcaa2770c71a727a3ee542 (diff) |
Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 6968049131..9648620ea0 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -240,8 +240,16 @@ static void DefineType(const char *MacroName, TargetInfo::IntType Ty, static void DefineExactWidthIntType(TargetInfo::IntType Ty, const TargetInfo &TI, std::vector<char> &Buf) { char MacroBuf[60]; - sprintf(MacroBuf, "__INT%d_TYPE__", TI.getTypeWidth(Ty)); + int TypeWidth = TI.getTypeWidth(Ty); + sprintf(MacroBuf, "__INT%d_TYPE__", TypeWidth); DefineType(MacroBuf, Ty, Buf); + + + const char *ConstSuffix = TargetInfo::getTypeConstantSuffix(Ty); + if (strlen(ConstSuffix) > 0) { + sprintf(MacroBuf, "__INT%d_C_SUFFIX__=%s", TypeWidth, ConstSuffix); + DefineBuiltinMacro(Buf, MacroBuf); + } } static void InitializePredefinedMacros(const TargetInfo &TI, |