Add method to return the type this type will be promoted to if it is

passed through a variable argument function.

llvm-svn: 21462
This commit is contained in:
Alkis Evlogimenos 2005-04-23 00:11:21 +00:00
parent 51efcefa49
commit 0166db6529
1 changed files with 14 additions and 0 deletions

View File

@ -236,6 +236,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
//