1313
1414#include " llvm/ADT/SmallPtrSet.h"
1515#include " llvm/ADT/DenseMapInfo.h"
16+ #include " llvm/ADT/STLExtras.h"
1617#include " llvm/Support/MathExtras.h"
1718#include " llvm/Support/MemAlloc.h"
1819#include < algorithm>
@@ -190,7 +191,7 @@ void SmallPtrSetImplBase::copyHelper(const SmallPtrSetImplBase &RHS) {
190191 CurArraySize = RHS.CurArraySize ;
191192
192193 // Copy over the contents from the other set
193- std ::copy (RHS.CurArray , RHS. EndPointer (), CurArray);
194+ llvm ::copy (RHS.buckets (), CurArray);
194195
195196 NumEntries = RHS.NumEntries ;
196197 NumTombstones = RHS.NumTombstones ;
@@ -214,7 +215,7 @@ void SmallPtrSetImplBase::moveHelper(const void **SmallStorage,
214215 if (RHS.isSmall ()) {
215216 // Copy a small RHS rather than moving.
216217 CurArray = SmallStorage;
217- std ::copy (RHS.CurArray , RHS. CurArray + RHS. NumEntries , CurArray);
218+ llvm ::copy (RHS.small_buckets () , CurArray);
218219 } else {
219220 CurArray = RHS.CurArray ;
220221 RHS.CurArray = RHSSmallStorage;
@@ -252,7 +253,7 @@ void SmallPtrSetImplBase::swap(const void **SmallStorage,
252253 // If only RHS is small, copy the small elements into LHS and move the pointer
253254 // from LHS to RHS.
254255 if (!this ->isSmall () && RHS.isSmall ()) {
255- std ::copy (RHS.CurArray , RHS. CurArray + RHS. NumEntries , SmallStorage);
256+ llvm ::copy (RHS.small_buckets () , SmallStorage);
256257 std::swap (RHS.CurArraySize , this ->CurArraySize );
257258 std::swap (this ->NumEntries , RHS.NumEntries );
258259 std::swap (this ->NumTombstones , RHS.NumTombstones );
@@ -266,8 +267,7 @@ void SmallPtrSetImplBase::swap(const void **SmallStorage,
266267 // If only LHS is small, copy the small elements into RHS and move the pointer
267268 // from RHS to LHS.
268269 if (this ->isSmall () && !RHS.isSmall ()) {
269- std::copy (this ->CurArray , this ->CurArray + this ->NumEntries ,
270- RHSSmallStorage);
270+ llvm::copy (this ->small_buckets (), RHSSmallStorage);
271271 std::swap (RHS.CurArraySize , this ->CurArraySize );
272272 std::swap (RHS.NumEntries , this ->NumEntries );
273273 std::swap (RHS.NumTombstones , this ->NumTombstones );
0 commit comments