[llvm] r230866 - IndexedMap: Default to SmallVector<T, 0>
Benjamin Kramer
benny.kra at googlemail.com
Sat Feb 28 12:15:07 PST 2015
Author: d0k
Date: Sat Feb 28 14:15:07 2015
New Revision: 230866
URL: http://llvm.org/viewvc/llvm-project?rev=230866&view=rev
Log:
IndexedMap: Default to SmallVector<T, 0>
This looks ridiculous but SmallVector's realloc tricks really help with
large vectors of PODs, such as our virtreg IndexedMap.
Modified:
llvm/trunk/include/llvm/ADT/IndexedMap.h
Modified: llvm/trunk/include/llvm/ADT/IndexedMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/IndexedMap.h?rev=230866&r1=230865&r2=230866&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/IndexedMap.h (original)
+++ llvm/trunk/include/llvm/ADT/IndexedMap.h Sat Feb 28 14:15:07 2015
@@ -21,16 +21,16 @@
#define LLVM_ADT_INDEXEDMAP_H
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallVector.h"
#include <cassert>
#include <functional>
-#include <vector>
namespace llvm {
template <typename T, typename ToIndexT = llvm::identity<unsigned> >
class IndexedMap {
typedef typename ToIndexT::argument_type IndexT;
- typedef std::vector<T> StorageT;
+ typedef SmallVector<T, 0> StorageT;
StorageT storage_;
T nullVal_;
ToIndexT toIndex_;
More information about the llvm-commits
mailing list