llvm.org GIT mirror llvm / e3f71b4
rename DenseMap -> IndexedMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33748 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
None //===- llvm/ADT/DenseMap.h - A dense map implmentation ----------*- C++ -*-===//
0 //===- llvm/ADT/IndexedMap.h - An index map implementation ------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file implements a dense map. A dense map template takes two
9 // This file implements an indexed map. The index map template takes two
1010 // types. The first is the mapped type and the second is a functor
1111 // that maps its argument to a size_t. On instantiation a "null" value
1212 // can be provided to be used as a "does not exist" indicator in the
1616 //
1717 //===----------------------------------------------------------------------===//
1818
19 #ifndef LLVM_ADT_DENSEMAP_H
20 #define LLVM_ADT_DENSEMAP_H
19 #ifndef LLVM_ADT_INDEXEDMAP_H
20 #define LLVM_ADT_INDEXEDMAP_H
2121
2222 #include
2323 #include
3232 };
3333
3434 template
35 class DenseMap {
35 class IndexMap {
3636 typedef typename ToIndexT::argument_type IndexT;
3737 typedef std::vector StorageT;
3838 StorageT storage_;
4040 ToIndexT toIndex_;
4141
4242 public:
43 DenseMap() : nullVal_(T()) { }
43 IndexMap() : nullVal_(T()) { }
4444
45 explicit DenseMap(const T& val) : nullVal_(val) { }
45 explicit IndexMap(const T& val) : nullVal_(val) { }
4646
4747 typename StorageT::reference operator[](IndexT n) {
4848 assert(toIndex_(n) < storage_.size() && "index out of bounds!");