[all-commits] [llvm/llvm-project] 9149ae: Support value-typed references in iterator facade'...

Christian Sigg via All-commits all-commits at lists.llvm.org
Tue Sep 21 11:42:41 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9149ae09bd1ef2934e2bc7bcaeffbb055739f074
      https://github.com/llvm/llvm-project/commit/9149ae09bd1ef2934e2bc7bcaeffbb055739f074
  Author: Christian Sigg <csigg at google.com>
  Date:   2021-09-21 (Tue, 21 Sep 2021)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/include/llvm/ADT/iterator.h
    M mlir/include/mlir/IR/BlockSupport.h
    M mlir/include/mlir/IR/BuiltinAttributes.h
    M mlir/include/mlir/IR/TypeRange.h
    M mlir/include/mlir/IR/TypeUtilities.h
    M mlir/include/mlir/IR/UseDefLists.h
    M mlir/include/mlir/TableGen/Operator.h

  Log Message:
  -----------
  Support value-typed references in iterator facade's operator->()

Add a PointerProxy similar to the existing iterator_facade_base::ReferenceProxy and return it from the arrow operator. This prevents iterator facades with a reference type that is not a true reference to take the address of a temporary.

Forward the reference type of the mapped_iterator to the iterator adaptor which in turn forwards it to the iterator facade. This fixes mlir::op_iterator::operator->() to take the address of a temporary.

Make some polishing changes to op_iterator and op_filter_iterator.

Reviewed By: rriddle

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




More information about the All-commits mailing list