aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Type.h14
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
//