1 //===- llvm/ADT/SmallMap.h - 'Normally small' pointer set -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the SmallMap class.
11 // SmallMap is DenseMap compatible MultiImplMap.
12 // It uses FlatArrayMap for small mode, and DenseMap for big mode.
13 // See MultiMapImpl comments for more details on the algorithm is used.
15 //===----------------------------------------------------------------------===//
17 #ifndef SMALLPTRMAP_H_
18 #define SMALLPTRMAP_H_
20 #include "llvm/ADT/DenseMap.h"
21 #include "llvm/ADT/FlatArrayMap.h"
22 #include "llvm/ADT/MultiImplMap.h"
26 //===--------------------------------------------------------------------===//
27 /// SmallMap is wrapper around MultiImplMap. It uses FlatArrayMap for
28 /// small mode, and DenseMap for big mode.
29 template <typename KeyTy, typename MappedTy, unsigned N = 16>
30 class SmallMap : public MultiImplMap<
31 FlatArrayMap<KeyTy, MappedTy, N>,
32 DenseMap<KeyTy, MappedTy>,
37 #endif /* SMALLPTRMAP_H_ */