allow a virtual register to be associated with live-in values.
[oota-llvm.git] / include / llvm / Type.h
index f832427934f0c859a01e8dcf8ede09b65dbccf79..502a9d9046aac6b033e782d30d42a95a70895b28 100644 (file)
@@ -218,6 +218,7 @@ public:
   /// return zero if the type does not have a size or is not a primitive type.
   ///
   unsigned getPrimitiveSize() const;
+  unsigned getPrimitiveSizeInBits() const;
 
   /// getUnsignedVersion - If this is an integer type, return the unsigned
   /// variant of this type.  For example int -> uint.
@@ -236,6 +237,20 @@ public:
     return getForwardedTypeInternal();
   }
 
+  /// getVAArgsPromotedType - Return the type an argument of this type
+  /// will be promoted to if passed through a variable argument
+  /// function.
+  const Type *getVAArgsPromotedType() const {
+    if (ID == BoolTyID || ID == UByteTyID || ID == UShortTyID)
+      return Type::UIntTy;
+    else if (ID == SByteTyID || ID == ShortTyID)
+      return Type::IntTy;
+    else if (ID == FloatTyID)
+      return Type::DoubleTy;
+    else
+      return this;
+  }
+
   //===--------------------------------------------------------------------===//
   // Type Iteration support
   //
@@ -280,8 +295,6 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const Type *T) { return true; }
 
-#include "llvm/Type.def"
-
   // Virtual methods used by callbacks below.  These should only be implemented
   // in the DerivedType class.
   virtual void addAbstractTypeUser(AbstractTypeUser *U) const {