Change this method to return ulong, not uint, for 64-bit targets.

llvm-svn: 18906
This commit is contained in:
Chris Lattner 2004-12-13 19:48:51 +00:00
parent 7f86ac4f54
commit 79c3a57af7
2 changed files with 5 additions and 6 deletions

View File

@ -558,7 +558,7 @@ public:
}
/// getSizeOf constant expr - computes the size of a type in a target
/// independent way (Note: the return type is UInt but the object is not
/// independent way (Note: the return type is ULong but the object is not
/// necessarily a ConstantUInt).
///
static Constant *getSizeOf(const Type *Ty);

View File

@ -1255,12 +1255,11 @@ Constant *ConstantExpr::getZeroExtend(Constant *C, const Type *Ty) {
}
Constant *ConstantExpr::getSizeOf(const Type *Ty) {
// sizeof is implemented as: (unsigned) gep (Ty*)null, 1
// sizeof is implemented as: (ulong) gep (Ty*)null, 1
return getCast(
getGetElementPtr(
getNullValue(PointerType::get(Ty)),
std::vector<Constant*>(1, ConstantInt::get(Type::UIntTy, 1))),
Type::UIntTy);
getGetElementPtr(getNullValue(PointerType::get(Ty)),
std::vector<Constant*>(1, ConstantInt::get(Type::UIntTy, 1))),
Type::ULongTy);
}
Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,