Reverting size_type for the containers from size_type to unsigned.
authorYaron Keren <yaron.keren@gmail.com>
Fri, 20 Jun 2014 12:20:56 +0000 (12:20 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Fri, 20 Jun 2014 12:20:56 +0000 (12:20 +0000)
Various places in LLVM assume that container size and count are unsigned
and do not use the container size_type. Therefore they break compilation
(or possibly executation) for LP64 systems where size_t is 64 bit while
unsigned is still 32 bit.

If we'll ever that many items in the container size_type could be made
size_t for a specific containers after reviweing its other uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211353 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/DenseMap.h
include/llvm/ADT/DenseSet.h
include/llvm/ADT/ScopedHashTable.h
include/llvm/ADT/SmallBitVector.h
include/llvm/ADT/SmallPtrSet.h
include/llvm/ADT/SparseBitVector.h
include/llvm/ADT/SparseMultiSet.h
include/llvm/ADT/SparseSet.h
include/llvm/IR/ValueMap.h

index 28a7b68a219a95778ee7baed2404ec1f6baf9c7c..85f37b9051b108225a5b04f699b0bb67b589ccca 100644 (file)
@@ -43,7 +43,7 @@ protected:
   typedef std::pair<KeyT, ValueT> BucketT;
 
 public:
-  typedef size_t size_type;
+  typedef unsigned size_type;
   typedef KeyT key_type;
   typedef ValueT mapped_type;
   typedef BucketT value_type;
index d74c6a89b2116cb2a1c8785ab4596059f56fd9a0..37a81b0c7ee2d70918897f8daec38c287d6be407 100644 (file)
@@ -29,7 +29,7 @@ class DenseSet {
 public:
   typedef ValueT key_type;
   typedef ValueT value_type;
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
 
   explicit DenseSet(unsigned NumInitBuckets = 0) : TheMap(NumInitBuckets) {}
 
index a9ff70e204a0ce9b2918e310f23c224639eecf45..02a6ea345834bb463885e59ffd3b1cf795897c8c 100644 (file)
@@ -148,7 +148,7 @@ public:
   /// ScopeTy - This is a helpful typedef that allows clients to get easy access
   /// to the name of the scope for this hash table.
   typedef ScopedHashTableScope<K, V, KInfo, AllocatorTy> ScopeTy;
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
 private:
   typedef ScopedHashTableVal<K, V> ValTy;
   DenseMap<K, ValTy*, KInfo> TopLevelMap;
index 18c68fdd4d242427331a635b580e17b1f762cf26..1e49e27001cf7df13454caece12ab7e3df9fab7d 100644 (file)
@@ -54,7 +54,7 @@ class SmallBitVector {
   };
 
 public:
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
   // Encapsulation of a single bit.
   class reference {
     SmallBitVector &TheVector;
index 45b2256bdf7010d8c2bb8ec47a7c99078130ebc4..74f3fd43cec4cbd1ecfdce82410d4905b9570da7 100644 (file)
@@ -73,7 +73,7 @@ protected:
   ~SmallPtrSetImplBase();
 
 public:
-  typedef size_t size_type;
+  typedef unsigned size_type;
   bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return size() == 0; }
   size_type size() const { return NumElements; }
 
index 16106a7d6304186e2572012fb61ada19c74547be..36754d682355c83e350a12afbb93831d66220b91 100644 (file)
@@ -45,7 +45,7 @@ struct SparseBitVectorElement
   : public ilist_node<SparseBitVectorElement<ElementSize> > {
 public:
   typedef unsigned long BitWord;
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
   enum {
     BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT,
     BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
index 92b9d835b70ce20b483d745bdb0425d4b9ba378d..dc1273eb7ff69dd9aabda93476ffacd4a5a42f77 100644 (file)
@@ -185,7 +185,7 @@ public:
   typedef const ValueT &const_reference;
   typedef ValueT *pointer;
   typedef const ValueT *const_pointer;
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
 
   SparseMultiSet()
     : Sparse(nullptr), Universe(0), FreelistIdx(SMSNode::INVALID), NumFree(0) {}
index e347667b4dc806f71b571770cd003f41a3d941dc..632d52ad9d822ae9edfce50bc313af2e5a462214 100644 (file)
@@ -124,7 +124,7 @@ class SparseSet {
 
   typedef typename KeyFunctorT::argument_type KeyT;
   typedef SmallVector<ValueT, 8> DenseT;
-  typedef size_t size_type;\r
+  typedef unsigned size_type;\r
   DenseT Dense;
   SparseT *Sparse;
   unsigned Universe;
index e459e4904c60eec5d6e35e390997164f906924fe..3d575ac874d943b235b59513804c235f2e70a102 100644 (file)
@@ -87,7 +87,7 @@ public:
   typedef KeyT key_type;
   typedef ValueT mapped_type;
   typedef std::pair<KeyT, ValueT> value_type;
-  typedef size_t size_type;
+  typedef unsigned size_type;
 
   explicit ValueMap(unsigned NumInitBuckets = 64)
     : Map(NumInitBuckets), Data() {}