mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
The count() function for STL datatypes returns unsigned, even where it's
only 1/0 result like std::set. Some of the LLVM ADT already return unsigned count(), while others still return bool count(). In continuation to r197879, this patch modifies DenseMap, DenseSet, ScopedHashTable, ValueMap:: count() to return size_type instead of bool, 1 instead of true and 0 instead of false. size_type is typedef-ed locally within each class to size_t. http://reviews.llvm.org/D4018 Reviewed by dblaikie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -29,7 +29,7 @@ template<typename KeyT, typename ValueT,
|
||||
typename MapType = llvm::DenseMap<KeyT, unsigned>,
|
||||
typename VectorType = std::vector<std::pair<KeyT, ValueT> > >
|
||||
class MapVector {
|
||||
typedef typename VectorType::size_type SizeType;
|
||||
typedef typename VectorType::size_type size_type;
|
||||
|
||||
MapType Map;
|
||||
VectorType Vector;
|
||||
@ -38,7 +38,7 @@ public:
|
||||
typedef typename VectorType::iterator iterator;
|
||||
typedef typename VectorType::const_iterator const_iterator;
|
||||
|
||||
SizeType size() const {
|
||||
size_type size() const {
|
||||
return Vector.size();
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
return std::make_pair(begin() + I, false);
|
||||
}
|
||||
|
||||
unsigned count(const KeyT &Key) const {
|
||||
size_type count(const KeyT &Key) const {
|
||||
typename MapType::const_iterator Pos = Map.find(Key);
|
||||
return Pos == Map.end()? 0 : 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user