Add new indexed_accessor_range_base and indexed_accessor_range classes that simplify...
authorRiver Riddle <riverriddle@google.com>
Mon, 9 Dec 2019 20:55:05 +0000 (12:55 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 9 Dec 2019 20:55:40 +0000 (12:55 -0800)
commit7be6a40ab9b914b14ab61ae13e47e0bb8237e74d
tree5ba05e5e9d2e88714654e891af3d2b69bbd923d2
parent56da74476c48cfb6af1eb32ad191c3463a7e10e3
Add new indexed_accessor_range_base and indexed_accessor_range classes that simplify defining index-able ranges.

Many ranges want similar functionality from a range type(e.g. slice/drop_front/operator[]/etc.), so these classes provide a generic implementation that may be used by many different types of ranges. This removes some code duplication, and also empowers many of the existing range types in MLIR(e.g. result type ranges, operand ranges, ElementsAttr ranges, etc.). This change only updates RegionRange and ValueRange, more ranges will be updated in followup commits.

PiperOrigin-RevId: 284615679
mlir/include/mlir/IR/Attributes.h
mlir/include/mlir/IR/Block.h
mlir/include/mlir/IR/Operation.h
mlir/include/mlir/IR/Region.h
mlir/include/mlir/Support/STLExtras.h
mlir/lib/IR/Attributes.cpp
mlir/lib/IR/Operation.cpp
mlir/lib/IR/Region.cpp