OSDN Git Service

[ADT] Improve the genericity of llvm::enumerate().
authorZachary Turner <zturner@google.com>
Mon, 13 Mar 2017 16:24:10 +0000 (16:24 +0000)
committerZachary Turner <zturner@google.com>
Mon, 13 Mar 2017 16:24:10 +0000 (16:24 +0000)
commit39e53ee48c9ce8404adff60856b76f7317298e56
tree3b6108eb32a07ecf59f4f0cd3ed766bfdf8d8626
parent111ee794a0e9dc5d769a4376b85f7a26a973c4eb
[ADT] Improve the genericity of llvm::enumerate().

There were some issues in the implementation of enumerate()
preventing it from being used in various contexts.  These were
all related to the fact that it did not supporter llvm's
iterator_facade_base class.  So this patch adds support for that
and additionally exposes a new helper method to_vector() that
will evaluate an entire range and store the results in a
vector.

Differential Revision: https://reviews.llvm.org/D30853

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297633 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/STLExtras.h
unittests/ADT/STLExtrasTest.cpp
utils/TableGen/GlobalISelEmitter.cpp