blob: 42d27ce77e388d7fa670d342291837d804cb0d1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
//===- llvm/ADT/SmallMap.h - 'Normally small' pointer set -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the SmallMap class.
// SmallMap is DenseMap compatible MultiImplMap.
// It uses FlatArrayMap for small mode, and DenseMap for big mode.
// See MultiMapImpl comments for more details on the algorithm is used.
//
//===----------------------------------------------------------------------===//
#ifndef SMALLPTRMAP_H_
#define SMALLPTRMAP_H_
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FlatArrayMap.h"
#include "llvm/ADT/MultiImplMap.h"
namespace llvm {
//===--------------------------------------------------------------------===//
/// SmallMap is wrapper around MultiImplMap. It uses FlatArrayMap for
/// small mode, and DenseMap for big mode.
template <typename KeyTy, typename MappedTy, unsigned N = 16>
class SmallMap : public MultiImplMap<
FlatArrayMap<KeyTy, MappedTy, N>,
DenseMap<KeyTy, MappedTy>,
N, true> {
};
}
#endif /* SMALLPTRMAP_H_ */
|