[PATCH] D53447: [adt] SparseBitVector::test() should be const

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 12:00:05 PDT 2018


dsanders created this revision.
Herald added subscribers: kristina, dexonsmith.

Re-worked SparseBitVector's most-recently-used-word caching (CurrElementIter)
such that SparseBitVector::test() can be made const. This came up when
attempting to test individual bits in a SparseBitVector which was a member of a
const object.

The cached iterator has no bearing on the externally visible state, it's merely
a performance optimization. Therefore it has been made mutable and
FindLowerBound() has been split into a const and non-const function
(FindLowerBound/FindLowerBoundConst) has been introduced for the const/non-const
interfaces.


Repository:
  rL LLVM

https://reviews.llvm.org/D53447

Files:
  include/llvm/ADT/SparseBitVector.h
  unittests/ADT/SparseBitVectorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53447.170230.patch
Type: text/x-patch
Size: 3865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181019/5667cc49/attachment.bin>


More information about the llvm-commits mailing list