diff options
Diffstat (limited to 'include/llvm/ADT/SmallSet.h')
-rw-r--r-- | include/llvm/ADT/SmallSet.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallSet.h b/include/llvm/ADT/SmallSet.h index 39a57b87b2a7..aaa5ff0ae939 100644 --- a/include/llvm/ADT/SmallSet.h +++ b/include/llvm/ADT/SmallSet.h @@ -38,6 +38,11 @@ class SmallSet { typedef typename SmallVector<T, N>::const_iterator VIterator; typedef typename SmallVector<T, N>::iterator mutable_iterator; + // In small mode SmallPtrSet uses linear search for the elements, so it is + // not a good idea to choose this value too high. You may consider using a + // DenseSet<> instead if you expect many elements in the set. + static_assert(N <= 32, "N should be small"); + public: typedef size_t size_type; SmallSet() {} |