From 0b08b96fdd9e9768aacbac5c5533624a48b34c42 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 2 Mar 2015 22:20:22 +0000 Subject: [PATCH] IndexedMap: Document why SmallVector is preferable here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231028 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/IndexedMap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/llvm/ADT/IndexedMap.h b/include/llvm/ADT/IndexedMap.h index a830a41f56d..5ba85c02792 100644 --- a/include/llvm/ADT/IndexedMap.h +++ b/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_;