diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-06 05:04:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-06 05:04:11 +0000 |
commit | 2b5abf515f9696912452f431c7738691cf97f4f1 (patch) | |
tree | bb222dd6e8d260561f90765c9673489563526bd3 /lib/Basic/TargetInfo.cpp | |
parent | 86d85b8e5e55db3079c9c22aecdb30d830793a50 (diff) |
simplify and refactor a bunch of type definition code in Preprocessor
predefines buffer initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/TargetInfo.cpp')
-rw-r--r-- | lib/Basic/TargetInfo.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 2b73582b78..378a91503b 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -51,6 +51,22 @@ TargetInfo::TargetInfo(const std::string &T) : Triple(T) { // Out of line virtual dtor for TargetInfo. TargetInfo::~TargetInfo() {} +/// getTypeName - Return the user string for the specified integer type enum. +/// For example, SignedShort -> "short". +const char *TargetInfo::getTypeName(IntType T) { + switch (T) { + default: assert(0 && "not an integer!"); + case SignedShort: return "short"; + case UnsignedShort: return "unsigned short"; + case SignedInt: return "int"; + case UnsignedInt: return "unsigned int"; + case SignedLong: return "long int"; + case UnsignedLong: return "long unsigned int"; + case SignedLongLong: return "long long int"; + case UnsignedLongLong: return "long long unsigned int"; + } +} + //===----------------------------------------------------------------------===// |