Change this method to return ulong, not uint, for 64-bit targets.
authorChris Lattner <sabre@nondot.org>
Mon, 13 Dec 2004 19:48:51 +0000 (19:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 13 Dec 2004 19:48:51 +0000 (19:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18906 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Constants.h
lib/VMCore/Constants.cpp

index 0663d60bfd7b374b66f039aaa8e6eb269ddd19f9..e8929f644314db8d115ba2f651a0740b7bc57f4d 100644 (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);
index 97e4fa565c7e06982bca4b299968e81c01bbe9d0..f09e3b94bb55046f56efa052391a6e3b44c20069 100644 (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,