Refactor data-in-code annotations.
[oota-llvm.git] / include / llvm / ADT / SmallMap.h
1 //===- llvm/ADT/SmallMap.h - 'Normally small' pointer set -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef SMALLPTRMAP_H_
18 #define SMALLPTRMAP_H_
19
20 #include "llvm/ADT/DenseMap.h"
21 #include "llvm/ADT/FlatArrayMap.h"
22 #include "llvm/ADT/MultiImplMap.h"
23
24 namespace llvm {
25
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>,
33                         N, true> {
34   };
35 }
36
37 #endif /* SMALLPTRMAP_H_ */