diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2005-04-23 00:11:21 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2005-04-23 00:11:21 +0000 |
commit | 4283d49e06cdf09963fddcd144dd7625070cd46d (patch) | |
tree | 1d53c2d5d04ab2507d17778cfefb0b0d8d4dbff2 /include/llvm/Type.h | |
parent | 2ebdb53c0166b91f793e06e660cb29231b9a9810 (diff) | |
download | external_llvm-4283d49e06cdf09963fddcd144dd7625070cd46d.zip external_llvm-4283d49e06cdf09963fddcd144dd7625070cd46d.tar.gz external_llvm-4283d49e06cdf09963fddcd144dd7625070cd46d.tar.bz2 |
Add method to return the type this type will be promoted to if it is
passed through a variable argument function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r-- | include/llvm/Type.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index f832427..443a6bc 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -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 // |