Allow arrays to have more than 4G elements.
authorChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 20:19:51 +0000 (20:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 20:19:51 +0000 (20:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19395 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 0496986ba0e7c4ed4ebf06688f782210a278c175..d2d6a2a9439daae0198bd45ccd1523a237962272 100644 (file)
@@ -401,7 +401,7 @@ StructType::StructType(const std::vector<const Type*> &Types)
   setAbstract(isAbstract);
 }
 
-ArrayType::ArrayType(const Type *ElType, unsigned NumEl)
+ArrayType::ArrayType(const Type *ElType, uint64_t NumEl)
   : SequentialType(ArrayTyID, ElType) {
   NumElements = NumEl;
 
@@ -894,16 +894,16 @@ FunctionType *FunctionType::get(const Type *ReturnType,
 namespace llvm {
 class ArrayValType {
   const Type *ValTy;
-  unsigned Size;
+  uint64_t Size;
 public:
-  ArrayValType(const Type *val, int sz) : ValTy(val), Size(sz) {}
+  ArrayValType(const Type *val, uint64_t sz) : ValTy(val), Size(sz) {}
 
   static ArrayValType get(const ArrayType *AT) {
     return ArrayValType(AT->getElementType(), AT->getNumElements());
   }
 
   static unsigned hashTypeStructure(const ArrayType *AT) {
-    return AT->getNumElements();
+    return (unsigned)AT->getNumElements();
   }
 
   // Subclass should override this... to update self as usual
@@ -921,7 +921,7 @@ public:
 static TypeMap<ArrayValType, ArrayType> ArrayTypes;
 
 
-ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) {
+ArrayType *ArrayType::get(const Type *ElementType, uint64_t NumElements) {
   assert(ElementType && "Can't get array of null types!");
 
   ArrayValType AVT(ElementType, NumElements);