[all-commits] [llvm/llvm-project] 99913e: [OpenMP] set_bits iterator yields unsigned element...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun Mar 29 09:09:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 99913ef3d14fcbfc939d9547506b55ac76fd0c59
      https://github.com/llvm/llvm-project/commit/99913ef3d14fcbfc939d9547506b55ac76fd0c59
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-03-29 (Sun, 29 Mar 2020)

  Changed paths:
    M llvm/lib/Frontend/OpenMP/OMPContext.cpp

  Log Message:
  -----------
  [OpenMP] set_bits iterator yields unsigned elements, no reference (NFC).

BitVector::set_bits() returns an iterator range yielding unsinged
elements, which always will be copied while const & gives the impression
that there will be no copy. Newer version of clang complain:

    warning: loop variable 'SetBitsIt' is always a copy because the range of type 'iterator_range<llvm::BitVector::const_set_bits_iterator>' (aka 'iterator_range<const_set_bits_iterator_impl<llvm::BitVector> >') does not return a reference [-Wrange-loop-analysis]

Reviewers: jdoerfert, rnk

Reviewed By: rnk

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




More information about the All-commits mailing list