diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2014-06-20 12:20:56 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2014-06-20 12:20:56 +0000 |
commit | 212e2b9c8dc74b16bd6297243c18064bae9ea113 (patch) | |
tree | 188f556b3fbef0c78ef9bb89c4e45155b347311c /include/llvm/ADT | |
parent | 7d5bff0d5a236a5e3a6f6a159d2a6607fb76368a (diff) | |
download | llvm-212e2b9c8dc74b16bd6297243c18064bae9ea113.tar.gz llvm-212e2b9c8dc74b16bd6297243c18064bae9ea113.tar.bz2 llvm-212e2b9c8dc74b16bd6297243c18064bae9ea113.tar.xz |
Reverting size_type for the containers from size_type to unsigned.
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
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/DenseMap.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/DenseSet.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/ScopedHashTable.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SmallBitVector.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SmallPtrSet.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SparseBitVector.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SparseMultiSet.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SparseSet.h | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 28a7b68a21..85f37b9051 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -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; diff --git a/include/llvm/ADT/DenseSet.h b/include/llvm/ADT/DenseSet.h index d74c6a89b2..37a81b0c7e 100644 --- a/include/llvm/ADT/DenseSet.h +++ b/include/llvm/ADT/DenseSet.h @@ -29,7 +29,7 @@ class DenseSet { public: typedef ValueT key_type; typedef ValueT value_type; - typedef size_t size_type;
+ typedef unsigned size_type;
explicit DenseSet(unsigned NumInitBuckets = 0) : TheMap(NumInitBuckets) {} diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h index a9ff70e204..02a6ea3458 100644 --- a/include/llvm/ADT/ScopedHashTable.h +++ b/include/llvm/ADT/ScopedHashTable.h @@ -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;
+ typedef unsigned size_type;
private: typedef ScopedHashTableVal<K, V> ValTy; DenseMap<K, ValTy*, KInfo> TopLevelMap; diff --git a/include/llvm/ADT/SmallBitVector.h b/include/llvm/ADT/SmallBitVector.h index 18c68fdd4d..1e49e27001 100644 --- a/include/llvm/ADT/SmallBitVector.h +++ b/include/llvm/ADT/SmallBitVector.h @@ -54,7 +54,7 @@ class SmallBitVector { }; public: - typedef size_t size_type;
+ typedef unsigned size_type;
// Encapsulation of a single bit. class reference { SmallBitVector &TheVector; diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index 45b2256bdf..74f3fd43ce 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -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; } diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h index 16106a7d63..36754d6823 100644 --- a/include/llvm/ADT/SparseBitVector.h +++ b/include/llvm/ADT/SparseBitVector.h @@ -45,7 +45,7 @@ struct SparseBitVectorElement : public ilist_node<SparseBitVectorElement<ElementSize> > { public: typedef unsigned long BitWord; - typedef size_t size_type;
+ typedef unsigned size_type;
enum { BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT, BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE, diff --git a/include/llvm/ADT/SparseMultiSet.h b/include/llvm/ADT/SparseMultiSet.h index 92b9d835b7..dc1273eb7f 100644 --- a/include/llvm/ADT/SparseMultiSet.h +++ b/include/llvm/ADT/SparseMultiSet.h @@ -185,7 +185,7 @@ public: typedef const ValueT &const_reference; typedef ValueT *pointer; typedef const ValueT *const_pointer; - typedef size_t size_type;
+ typedef unsigned size_type;
SparseMultiSet() : Sparse(nullptr), Universe(0), FreelistIdx(SMSNode::INVALID), NumFree(0) {} diff --git a/include/llvm/ADT/SparseSet.h b/include/llvm/ADT/SparseSet.h index e347667b4d..632d52ad9d 100644 --- a/include/llvm/ADT/SparseSet.h +++ b/include/llvm/ADT/SparseSet.h @@ -124,7 +124,7 @@ class SparseSet { typedef typename KeyFunctorT::argument_type KeyT; typedef SmallVector<ValueT, 8> DenseT; - typedef size_t size_type;
+ typedef unsigned size_type;
DenseT Dense; SparseT *Sparse; unsigned Universe; |