[llvm-commits] CVS: llvm/include/llvm/Type.h

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Apr 22 17:11:32 PDT 2005



Changes in directory llvm/include/llvm:

Type.h updated: 1.75 -> 1.76
---
Log message:

Add method to return the type this type will be promoted to if it is
passed through a variable argument function.


---
Diffs of the changes:  (+14 -0)

 Type.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+)


Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.75 llvm/include/llvm/Type.h:1.76
--- llvm/include/llvm/Type.h:1.75	Thu Apr 21 15:11:51 2005
+++ llvm/include/llvm/Type.h	Fri Apr 22 19:11:21 2005
@@ -236,6 +236,20 @@
     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
   //






More information about the llvm-commits mailing list