diff options
Diffstat (limited to 'include/llvm/ADT/SparseSet.h')
-rw-r--r-- | include/llvm/ADT/SparseSet.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/llvm/ADT/SparseSet.h b/include/llvm/ADT/SparseSet.h index ded48c5746..b46ccc9375 100644 --- a/include/llvm/ADT/SparseSet.h +++ b/include/llvm/ADT/SparseSet.h @@ -118,6 +118,10 @@ template<typename ValueT, typename KeyFunctorT = llvm::identity<unsigned>, typename SparseT = uint8_t> class SparseSet { + static_assert(std::numeric_limits<SparseT>::is_integer && + !std::numeric_limits<SparseT>::is_signed, + "SparseT must be an unsigned integer type"); + typedef typename KeyFunctorT::argument_type KeyT; typedef SmallVector<ValueT, 8> DenseT; DenseT Dense; @@ -198,9 +202,6 @@ public: /// iterator findIndex(unsigned Idx) { assert(Idx < Universe && "Key out of range"); - assert(std::numeric_limits<SparseT>::is_integer && - !std::numeric_limits<SparseT>::is_signed && - "SparseT must be an unsigned integer type"); const unsigned Stride = std::numeric_limits<SparseT>::max() + 1u; for (unsigned i = Sparse[Idx], e = size(); i < e; i += Stride) { const unsigned FoundIdx = ValIndexOf(Dense[i]); |