mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230866 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f4cff31d3c
commit
ce770dda2c
@ -21,16 +21,16 @@
|
|||||||
#define LLVM_ADT_INDEXEDMAP_H
|
#define LLVM_ADT_INDEXEDMAP_H
|
||||||
|
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
template <typename T, typename ToIndexT = llvm::identity<unsigned> >
|
template <typename T, typename ToIndexT = llvm::identity<unsigned> >
|
||||||
class IndexedMap {
|
class IndexedMap {
|
||||||
typedef typename ToIndexT::argument_type IndexT;
|
typedef typename ToIndexT::argument_type IndexT;
|
||||||
typedef std::vector<T> StorageT;
|
typedef SmallVector<T, 0> StorageT;
|
||||||
StorageT storage_;
|
StorageT storage_;
|
||||||
T nullVal_;
|
T nullVal_;
|
||||||
ToIndexT toIndex_;
|
ToIndexT toIndex_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user