@@ -137,10 +137,6 @@ template <typename KeyT, typename ValueT> class Memoizer {
137137template <typename Key1, typename Key2, typename Value> class TwoStageMap {
138138public:
139139 // Define this here so it can be changed easily.
140- // TODO: Use llvm structure such as DenseMap. However, DenseMap does not
141- // preserve pointers to elements, so be careful!
142- // TODO: Consider using an ordered structure to guarantee determinism
143- // when compilation order changes.
144140 template <typename Key, typename MapValue>
145141 using Map = std::unordered_map<Key, MapValue>;
146142
@@ -188,32 +184,6 @@ template <typename Key1, typename Key2, typename Value> class TwoStageMap {
188184 // / Returns the submap at \p k1. May create one if not present.
189185 Map<Key2, Value> &operator [](const Key1 &k1) { return map[k1]; }
190186
191- // / Invoke \p fn on each Key2 and Value matching (k, *)
192- void forEachValueMatching (
193- const Key1 &k1,
194- function_ref<void (const Key2 &, const Value &)> fn) const {
195- const auto &iter = map.find (k1);
196- if (iter == map.end ())
197- return ;
198- for (auto &p : iter->second )
199- fn (p.first , p.second );
200- }
201-
202- // / Invoke \p fn for each entry
203- void forEachEntry (
204- function_ref<void (const Key1 &, const Key2 &, const Value &)> fn) const {
205- for (const auto &p : map)
206- for (const auto &p2 : p.second )
207- fn (p.first , p2.first , p2.second );
208- }
209-
210- // / Invoke fn for each Key1 and submap
211- void
212- forEachKey1 (function_ref<void (const Key1 &, const InnerMap &)> fn) const {
213- for (const auto &p : map)
214- fn (p.first , p.second );
215- }
216-
217187 // / Check integrity and call \p verifyFn for each element, so that element can
218188 // / be verified.
219189 // /
@@ -292,36 +262,6 @@ class BiIndexedTwoStageMap {
292262 return findAndErase (k1, k2);
293263 }
294264
295- // / Invoke \p fn on each Key2 and Value matching (\p k1, *)
296- void forEachValueMatching (
297- const Key1 &k1,
298- function_ref<void (const Key2 &, const Value &)> fn) const {
299- map1.forEachValueMatching (k1, fn);
300- }
301-
302- // / Invoke \p fn on each Key1 and Value matching (*, \p k2)
303- void forEachValueMatching (
304- const Key2 &k2,
305- function_ref<void (const Key1 &, const Value &)> fn) const {
306- map2.forEachValueMatching (k2, fn);
307- }
308-
309- // / Invoke \p fn for each entry
310- void forEachEntry (
311- function_ref<void (const Key1 &, const Key2 &, const Value &)> fn) const {
312- map1.forEachEntry (fn);
313- }
314-
315- // / Invoke fn for each Key1 and submap
316- void forEachKey1 (function_ref<void (const Key1 &, const Key2Map &)> fn) const {
317- map1.forEachKey1 (fn);
318- }
319-
320- // / Invoke fn for each Key2 and submap
321- void forEachKey2 (function_ref<void (const Key1 &, const Key1Map &)> fn) const {
322- map2.forEachKey1 (fn);
323- }
324-
325265 // / Verify the integrity of each map and the cross-map consistency.
326266 // / Then call \p verifyFn for each entry found in each of the two maps,
327267 // / passing an index so that the verifyFn knows which map is being tested.
0 commit comments