IndexedMap: Document why SmallVector<T, 0> is preferable here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231028 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2015-03-02 22:20:22 +00:00
parent e4ffd28ade
commit 0b08b96fdd

View File

@ -30,6 +30,9 @@ namespace llvm {
template <typename T, typename ToIndexT = llvm::identity<unsigned> >
class IndexedMap {
typedef typename ToIndexT::argument_type IndexT;
// Prefer SmallVector with zero inline storage over std::vector. IndexedMaps
// can grow very large and SmallVector grows more efficiently as long as T
// is trivially copyable.
typedef SmallVector<T, 0> StorageT;
StorageT storage_;
T nullVal_;