This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] set_bits iterator yields unsigned elements, no reference (NFC).
ClosedPublic

Authored by fhahn on Mar 29 2020, 3:47 AM.

Details

Summary

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]

Diff Detail

Event Timeline

fhahn created this revision.Mar 29 2020, 3:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2020, 3:47 AM
rnk accepted this revision.Mar 29 2020, 7:03 AM

Lgtm, thanks, I was seeing this locally

This revision is now accepted and ready to land.Mar 29 2020, 7:03 AM
This revision was automatically updated to reflect the committed changes.