Refactor the various operand/result/type iterators to use indexed_accessor_range.
authorRiver Riddle <riverriddle@google.com>
Tue, 10 Dec 2019 21:20:50 +0000 (13:20 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 10 Dec 2019 21:21:22 +0000 (13:21 -0800)
commit9ed22ae5b8c8f286a992bca7ef4e4b3263c01116
tree1781704cc7e22fd8294b90c758eb1fde583b9c63
parentb19fed5415386b6485586fdfb176be0c57b19a54
Refactor the various operand/result/type iterators to use indexed_accessor_range.

This has several benefits:
* The implementation is much cleaner and more efficient.
* The ranges now have support for many useful operations: operator[], slice, drop_front, size, etc.
* Value ranges can now directly query a range for their types via 'getTypes()': e.g:
   void foo(Operation::operand_range operands) {
     auto operandTypes = operands.getTypes();
   }

PiperOrigin-RevId: 284834912
mlir/include/mlir/IR/BlockSupport.h
mlir/include/mlir/IR/Operation.h
mlir/include/mlir/IR/OperationSupport.h
mlir/include/mlir/IR/Region.h
mlir/include/mlir/IR/TypeUtilities.h
mlir/include/mlir/Support/STLExtras.h
mlir/lib/Dialect/StandardOps/Ops.cpp
mlir/lib/IR/Operation.cpp
mlir/lib/IR/OperationSupport.cpp
mlir/lib/IR/TypeUtilities.cpp