[PATCH] D93992: [STLExtras] Use return type from operator* of the wrapped iter.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 3 08:14:08 PST 2021
fhahn created this revision.
fhahn added reviewers: dblaikie, chandlerc, dexonsmith.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.
Currently make_early_inc_range cannot be used with iterators with
operator* implementations that do not return a reference.
Most notably in the LLVM codebase, this means the User iterator ranges
cannot be used with make_early_inc_range, which slightly simplifies
iterating over ranges while elements are removed.
Instead of directly using BaseT::reference as return type of operator*,
this patch uses decltype to get the actual return type of the operator*
implementation in WrappedIteratorT.
This patch also updates a few places to use make use of
make_early_inc_range.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D93992
Files:
llvm/include/llvm/ADT/STLExtras.h
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93992.314287.patch
Type: text/x-patch
Size: 6790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210103/4f34e2ec/attachment.bin>
More information about the llvm-commits
mailing list