diff --git a/llvm/include/llvm/ADT/IndexedMap.h b/llvm/include/llvm/ADT/IndexedMap.h index a830a41f56db7..5ba85c0279209 100644 --- a/llvm/include/llvm/ADT/IndexedMap.h +++ b/llvm/include/llvm/ADT/IndexedMap.h @@ -30,6 +30,9 @@ namespace llvm { template > 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 StorageT; StorageT storage_; T nullVal_;