diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-12-13 19:48:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-12-13 19:48:51 +0000 |
| commit | acc4e545523c98fb55ae9ea0ef17f08192c9eb42 (patch) | |
| tree | 3087051e01ab6992e84df450f0e15edc5b0ecade | |
| parent | 5417117a8f260e3bda81c11cd4b04c4f56744c9f (diff) | |
| download | bcm5719-llvm-acc4e545523c98fb55ae9ea0ef17f08192c9eb42.tar.gz bcm5719-llvm-acc4e545523c98fb55ae9ea0ef17f08192c9eb42.zip | |
Change this method to return ulong, not uint, for 64-bit targets.
llvm-svn: 18906
| -rw-r--r-- | llvm/include/llvm/Constants.h | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h index 0663d60bfd7..e8929f64431 100644 --- a/llvm/include/llvm/Constants.h +++ b/llvm/include/llvm/Constants.h @@ -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); diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 97e4fa565c7..f09e3b94bb5 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -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, |

