[llvm] r211353 - Reverting size_type for the containers from size_type to unsigned.
Yaron Keren
yaron.keren at gmail.com
Fri Jun 20 05:20:56 PDT 2014
Author: yrnkrn
Date: Fri Jun 20 07:20:56 2014
New Revision: 211353
URL: http://llvm.org/viewvc/llvm-project?rev=211353&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
llvm/trunk/include/llvm/ADT/DenseSet.h
llvm/trunk/include/llvm/ADT/ScopedHashTable.h
llvm/trunk/include/llvm/ADT/SmallBitVector.h
llvm/trunk/include/llvm/ADT/SmallPtrSet.h
llvm/trunk/include/llvm/ADT/SparseBitVector.h
llvm/trunk/include/llvm/ADT/SparseMultiSet.h
llvm/trunk/include/llvm/ADT/SparseSet.h
llvm/trunk/include/llvm/IR/ValueMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Fri Jun 20 07:20:56 2014
@@ -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;
Modified: llvm/trunk/include/llvm/ADT/DenseSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseSet.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseSet.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseSet.h Fri Jun 20 07:20:56 2014
@@ -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) {}
Modified: llvm/trunk/include/llvm/ADT/ScopedHashTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ScopedHashTable.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ScopedHashTable.h (original)
+++ llvm/trunk/include/llvm/ADT/ScopedHashTable.h Fri Jun 20 07:20:56 2014
@@ -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;
Modified: llvm/trunk/include/llvm/ADT/SmallBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallBitVector.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallBitVector.h Fri Jun 20 07:20:56 2014
@@ -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;
Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Fri Jun 20 07:20:56 2014
@@ -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; }
Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Fri Jun 20 07:20:56 2014
@@ -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,
Modified: llvm/trunk/include/llvm/ADT/SparseMultiSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseMultiSet.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseMultiSet.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseMultiSet.h Fri Jun 20 07:20:56 2014
@@ -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) {}
Modified: llvm/trunk/include/llvm/ADT/SparseSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseSet.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseSet.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseSet.h Fri Jun 20 07:20:56 2014
@@ -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;
Modified: llvm/trunk/include/llvm/IR/ValueMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ValueMap.h?rev=211353&r1=211352&r2=211353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/ValueMap.h (original)
+++ llvm/trunk/include/llvm/IR/ValueMap.h Fri Jun 20 07:20:56 2014
@@ -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() {}
More information about the llvm-commits
mailing list