Lines Matching refs:RHS
144 void SmallPtrSetImplBase::CopyFrom(const SmallPtrSetImplBase &RHS) { in CopyFrom() argument
145 assert(&RHS != this && "Self-copy should be handled by the caller."); in CopyFrom()
147 if (isSmall() && RHS.isSmall()) in CopyFrom()
148 assert(CurArraySize == RHS.CurArraySize && in CopyFrom()
152 if (RHS.isSmall()) { in CopyFrom()
157 } else if (CurArraySize != RHS.CurArraySize) { in CopyFrom()
159 CurArray = (const void**)safe_malloc(sizeof(void*) * RHS.CurArraySize); in CopyFrom()
162 sizeof(void*) * RHS.CurArraySize); in CopyFrom()
167 CopyHelper(RHS); in CopyFrom()
170 void SmallPtrSetImplBase::CopyHelper(const SmallPtrSetImplBase &RHS) { in CopyHelper() argument
172 CurArraySize = RHS.CurArraySize; in CopyHelper()
175 std::copy(RHS.CurArray, RHS.EndPointer(), CurArray); in CopyHelper()
177 NumNonEmpty = RHS.NumNonEmpty; in CopyHelper()
178 NumTombstones = RHS.NumTombstones; in CopyHelper()
182 SmallPtrSetImplBase &&RHS) { in MoveFrom() argument
185 MoveHelper(SmallSize, std::move(RHS)); in MoveFrom()
189 SmallPtrSetImplBase &&RHS) { in MoveHelper() argument
190 assert(&RHS != this && "Self-move should be handled by the caller."); in MoveHelper()
192 if (RHS.isSmall()) { in MoveHelper()
195 std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, CurArray); in MoveHelper()
197 CurArray = RHS.CurArray; in MoveHelper()
198 RHS.CurArray = RHS.SmallArray; in MoveHelper()
202 CurArraySize = RHS.CurArraySize; in MoveHelper()
203 NumNonEmpty = RHS.NumNonEmpty; in MoveHelper()
204 NumTombstones = RHS.NumTombstones; in MoveHelper()
207 RHS.CurArraySize = SmallSize; in MoveHelper()
208 assert(RHS.CurArray == RHS.SmallArray); in MoveHelper()
209 RHS.NumNonEmpty = 0; in MoveHelper()
210 RHS.NumTombstones = 0; in MoveHelper()
213 void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) { in swap() argument
214 if (this == &RHS) return; in swap()
217 if (!this->isSmall() && !RHS.isSmall()) { in swap()
218 std::swap(this->CurArray, RHS.CurArray); in swap()
219 std::swap(this->CurArraySize, RHS.CurArraySize); in swap()
220 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
221 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()
229 if (!this->isSmall() && RHS.isSmall()) { in swap()
230 assert(RHS.CurArray == RHS.SmallArray); in swap()
231 std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, this->SmallArray); in swap()
232 std::swap(RHS.CurArraySize, this->CurArraySize); in swap()
233 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
234 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()
235 RHS.CurArray = this->CurArray; in swap()
242 if (this->isSmall() && !RHS.isSmall()) { in swap()
245 RHS.SmallArray); in swap()
246 std::swap(RHS.CurArraySize, this->CurArraySize); in swap()
247 std::swap(RHS.NumNonEmpty, this->NumNonEmpty); in swap()
248 std::swap(RHS.NumTombstones, this->NumTombstones); in swap()
249 this->CurArray = RHS.CurArray; in swap()
250 RHS.CurArray = RHS.SmallArray; in swap()
255 assert(this->isSmall() && RHS.isSmall()); in swap()
256 unsigned MinNonEmpty = std::min(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
258 RHS.SmallArray); in swap()
262 RHS.SmallArray + MinNonEmpty); in swap()
264 std::copy(RHS.SmallArray + MinNonEmpty, RHS.SmallArray + RHS.NumNonEmpty, in swap()
267 assert(this->CurArraySize == RHS.CurArraySize); in swap()
268 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
269 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()