Lines Matching refs:RHS
145 void SmallPtrSetImplBase::CopyFrom(const SmallPtrSetImplBase &RHS) { in CopyFrom() argument
146 assert(&RHS != this && "Self-copy should be handled by the caller."); in CopyFrom()
148 if (isSmall() && RHS.isSmall()) in CopyFrom()
149 assert(CurArraySize == RHS.CurArraySize && in CopyFrom()
153 if (RHS.isSmall()) { in CopyFrom()
158 } else if (CurArraySize != RHS.CurArraySize) { in CopyFrom()
160 CurArray = (const void**)safe_malloc(sizeof(void*) * RHS.CurArraySize); in CopyFrom()
163 sizeof(void*) * RHS.CurArraySize); in CopyFrom()
168 CopyHelper(RHS); in CopyFrom()
171 void SmallPtrSetImplBase::CopyHelper(const SmallPtrSetImplBase &RHS) { in CopyHelper() argument
173 CurArraySize = RHS.CurArraySize; in CopyHelper()
176 std::copy(RHS.CurArray, RHS.EndPointer(), CurArray); in CopyHelper()
178 NumNonEmpty = RHS.NumNonEmpty; in CopyHelper()
179 NumTombstones = RHS.NumTombstones; in CopyHelper()
183 SmallPtrSetImplBase &&RHS) { in MoveFrom() argument
186 MoveHelper(SmallSize, std::move(RHS)); in MoveFrom()
190 SmallPtrSetImplBase &&RHS) { in MoveHelper() argument
191 assert(&RHS != this && "Self-move should be handled by the caller."); in MoveHelper()
193 if (RHS.isSmall()) { in MoveHelper()
196 std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, CurArray); in MoveHelper()
198 CurArray = RHS.CurArray; in MoveHelper()
199 RHS.CurArray = RHS.SmallArray; in MoveHelper()
203 CurArraySize = RHS.CurArraySize; in MoveHelper()
204 NumNonEmpty = RHS.NumNonEmpty; in MoveHelper()
205 NumTombstones = RHS.NumTombstones; in MoveHelper()
208 RHS.CurArraySize = SmallSize; in MoveHelper()
209 assert(RHS.CurArray == RHS.SmallArray); in MoveHelper()
210 RHS.NumNonEmpty = 0; in MoveHelper()
211 RHS.NumTombstones = 0; in MoveHelper()
214 void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) { in swap() argument
215 if (this == &RHS) return; in swap()
218 if (!this->isSmall() && !RHS.isSmall()) { in swap()
219 std::swap(this->CurArray, RHS.CurArray); in swap()
220 std::swap(this->CurArraySize, RHS.CurArraySize); in swap()
221 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
222 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()
230 if (!this->isSmall() && RHS.isSmall()) { in swap()
231 assert(RHS.CurArray == RHS.SmallArray); in swap()
232 std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, this->SmallArray); in swap()
233 std::swap(RHS.CurArraySize, this->CurArraySize); in swap()
234 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
235 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()
236 RHS.CurArray = this->CurArray; in swap()
243 if (this->isSmall() && !RHS.isSmall()) { in swap()
246 RHS.SmallArray); in swap()
247 std::swap(RHS.CurArraySize, this->CurArraySize); in swap()
248 std::swap(RHS.NumNonEmpty, this->NumNonEmpty); in swap()
249 std::swap(RHS.NumTombstones, this->NumTombstones); in swap()
250 this->CurArray = RHS.CurArray; in swap()
251 RHS.CurArray = RHS.SmallArray; in swap()
256 assert(this->isSmall() && RHS.isSmall()); in swap()
257 unsigned MinNonEmpty = std::min(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
259 RHS.SmallArray); in swap()
263 RHS.SmallArray + MinNonEmpty); in swap()
265 std::copy(RHS.SmallArray + MinNonEmpty, RHS.SmallArray + RHS.NumNonEmpty, in swap()
268 assert(this->CurArraySize == RHS.CurArraySize); in swap()
269 std::swap(this->NumNonEmpty, RHS.NumNonEmpty); in swap()
270 std::swap(this->NumTombstones, RHS.NumTombstones); in swap()