summaryrefslogtreecommitdiff
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-19 21:13:56 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-19 21:13:56 +0000
commitc10305743c313558405079452138f03124e87581 (patch)
tree247e4b54c39472e2f210f8f57cef3ab763ab6b25 /lib/VMCore/Type.cpp
parent011cf09ddd3cf759de55ff1f95ef37a3f04c70c9 (diff)
downloadllvm-c10305743c313558405079452138f03124e87581.tar.gz
llvm-c10305743c313558405079452138f03124e87581.tar.bz2
llvm-c10305743c313558405079452138f03124e87581.tar.xz
For PR1043:
This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 00c6d48dce..0e9e25cf8b 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -81,6 +81,15 @@ const Type *Type::getPrimitiveType(TypeID IDNumber) {
}
}
+const Type *Type::getVAArgsPromotedType() const {
+ if (ID == IntegerTyID && getSubclassData() < 32)
+ return Type::Int32Ty;
+ else if (ID == FloatTyID)
+ return Type::DoubleTy;
+ else
+ return this;
+}
+
/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
///
bool Type::isFPOrFPVector() const {
@@ -352,7 +361,7 @@ const Type *StructType::getTypeAtIndex(const Value *V) const {
}; \
} \
static ManagedStatic<TY##Type> The##TY##Ty; \
- const Type *Type::TY##Ty = &*The##TY##Ty
+ const IntegerType *Type::TY##Ty = &*The##TY##Ty
DeclarePrimType(Void, "void");
DeclarePrimType(Float, "float");