[all-commits] [llvm/llvm-project] c701f8: [STLExtras] Use return type from operator* of the ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun Jan 10 07:52:58 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c701f85c45589091f0d232fc2bc0bc390a6ab684
      https://github.com/llvm/llvm-project/commit/c701f85c45589091f0d232fc2bc0bc390a6ab684
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-01-10 (Sun, 10 Jan 2021)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/lib/Analysis/MemoryBuiltins.cpp
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
    M llvm/unittests/ADT/STLExtrasTest.cpp

  Log Message:
  -----------
  [STLExtras] Use return type from operator* of the wrapped iter.

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.

Reviewed By: dblaikie

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




More information about the All-commits mailing list