[llvm] Make Sequence reverse-iterable
authorGuillaume Chatelet <gchatelet@google.com>
Tue, 8 Jun 2021 13:18:57 +0000 (13:18 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Tue, 8 Jun 2021 13:18:57 +0000 (13:18 +0000)
commite772216e708937988c039420d2c559568f91ae27
tree5b704518dae98546167f0c5ed036946d03fb3ec3
parent386b66b2fc297cda121a3cc8a36887a6ecbcfc68
[llvm] Make Sequence reverse-iterable

This patch simplifies the implementation of Sequence and makes it compatible with llvm::reverse.
It exposes the reverse iterators through rbegin/rend which prevents a dangling reference in std::reverse_iterator::operator++().

Differential Revision: https://reviews.llvm.org/D102679
llvm/include/llvm/ADT/Sequence.h
llvm/unittests/ADT/SequenceTest.cpp
mlir/include/mlir/IR/BuiltinAttributes.td
mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp