Add some helper methods.
authorChris Lattner <sabre@nondot.org>
Sat, 15 Jan 2005 06:52:18 +0000 (06:52 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 15 Jan 2005 06:52:18 +0000 (06:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19570 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ValueTypes.h

index ca430e4a252c2e018be32babf4f1d39c401f932d..ce6cb0764f191b66d56455b511057f94b69f72d1 100644 (file)
@@ -19,6 +19,7 @@
 #include <cassert>
 
 namespace llvm {
+  class Type;
 
 /// MVT namespace - This namespace defines the ValueType enum, which contains
 /// the various low-level value types.
@@ -67,6 +68,15 @@ namespace MVT {  // MVT = Machine Value Types
     case MVT::i128: return 128;
     }
   }
+
+  /// MVT::getValueTypeString - This function returns value type as a string,
+  /// e.g. "i32".
+  const char *getValueTypeString(ValueType VT);
+
+  /// MVT::getTypeForValueType - This method returns an LLVM type corresponding
+  /// to the specified ValueType.  For integer types, this returns an unsigned
+  /// type.  Note that this will abort for types that cannot be represented.
+  const Type *getTypeForValueType(ValueType VT);
 };
 
 } // End llvm namespace