[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Jan 8 12:20:05 PST 2005



Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.120 -> 1.121
---
Log message:

Allow arrays to have more than 4G elements.


---
Diffs of the changes:  (+5 -5)

Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.120 llvm/lib/VMCore/Type.cpp:1.121
--- llvm/lib/VMCore/Type.cpp:1.120	Wed Dec  1 11:12:16 2004
+++ llvm/lib/VMCore/Type.cpp	Sat Jan  8 14:19:51 2005
@@ -401,7 +401,7 @@
   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 @@
 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 @@
 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);






More information about the llvm-commits mailing list