forked from OSchip/llvm-project
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. llvm-svn: 211353
This commit is contained in:
parent
236070f20d
commit
c2a363aa33
|
@ -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;
|
||||
|
|
|
@ -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) {}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {}
|
||||
|
|
Loading…
Reference in New Issue