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
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp
index 2b73582..378a915 100644
--- a/lib/Basic/TargetInfo.cpp
+++ b/lib/Basic/TargetInfo.cpp
@@ -51,6 +51,22 @@
 // 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";
+  }
+}
+
 //===----------------------------------------------------------------------===//