[PATCH] D109490: Support value-typed references in iterator facade's operator->()

Christian Sigg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 01:12:52 PDT 2021


csigg created this revision.
csigg added a reviewer: rriddle.
Herald added subscribers: wenzhicui, wrengr, Chia-hungDuan, dcaballe, cota, teijeong, dexonsmith, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, mehdi_amini, sanjoy.google.
csigg requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: MLIR, LLVM.

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 the the address of a temporary.

Make some polishing changes to op_iterator and op_filter_iterator.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109490

Files:
  llvm/include/llvm/ADT/STLExtras.h
  llvm/include/llvm/ADT/iterator.h
  mlir/include/mlir/IR/BlockSupport.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109490.371520.patch
Type: text/x-patch
Size: 4532 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210909/b82a6677/attachment.bin>


More information about the llvm-commits mailing list