/// 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.
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
//
/// 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 {