diff options
| author | Joerg Sonnenberger <joerg@bec.de> | 2014-07-15 11:30:00 +0000 |
|---|---|---|
| committer | Joerg Sonnenberger <joerg@bec.de> | 2014-07-15 11:30:00 +0000 |
| commit | be324f983238de812cab748c61fb62c748c8469b (patch) | |
| tree | 2f4a647bc155769def49878d23b42ecae8c225a3 /clang/lib/Basic | |
| parent | 18611cff58dd9a11f43155cb709daf3a19ec4c2e (diff) | |
| download | bcm5719-llvm-be324f983238de812cab748c61fb62c748c8469b.tar.gz bcm5719-llvm-be324f983238de812cab748c61fb62c748c8469b.zip | |
Provide builtin macros as template for PRIab and SCNab, matching the
underlaying types.
llvm-svn: 213063
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/TargetInfo.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index 13d78e998e3..8d81035ce80 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -134,6 +134,25 @@ const char *TargetInfo::getTypeConstantSuffix(IntType T) { } } +/// getTypeFormatModifier - Return the printf format modifier for the +/// specified integer type enum. For example, SignedLong -> "l". + +const char *TargetInfo::getTypeFormatModifier(IntType T) { + switch (T) { + default: llvm_unreachable("not an integer!"); + case SignedChar: + case UnsignedChar: return "hh"; + case SignedShort: + case UnsignedShort: return "h"; + case SignedInt: + case UnsignedInt: return ""; + case SignedLong: + case UnsignedLong: return "l"; + case SignedLongLong: + case UnsignedLongLong: return "ll"; + } +} + /// getTypeWidth - Return the width (in bits) of the specified integer type /// enum. For example, SignedInt -> getIntWidth(). unsigned TargetInfo::getTypeWidth(IntType T) const { |

