Improve StringMap iterator support.
StringMap's iterators did not support LLVM's iterator_facade_base, which made it unusable in various STL algorithms or with some of our range adapters. This patch makes both StringMapConstIterator as well as StringMapIterator support iterator_facade_base. With this in place, it is easy to make an iterator adapter that iterates over only keys, and whose value_type is StringRef. So I add StringMapKeyIterator as well, and provide the method StringMap::keys() that returns a range that can be iterated. Differential Revision: https://reviews.llvm.org/D31171 llvm-svn: 298436
Loading
Please register or sign in to comment