llvm.org GIT mirror llvm / d25872f
DenseMap: we're trying to call the reserved global placement allocation function here; use "::new" to avoid accidentally picking up a class-specific operator new. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249112 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 4 years ago
1 changed file(s) with 13 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
281281 "# initial buckets must be a power of two!");
282282 const KeyT EmptyKey = getEmptyKey();
283283 for (BucketT *B = getBuckets(), *E = getBucketsEnd(); B != E; ++B)
284 new (&B->getFirst()) KeyT(EmptyKey);
284 ::new (&B->getFirst()) KeyT(EmptyKey);
285285 }
286286
287287 void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) {
299299 (void)FoundVal; // silence warning.
300300 assert(!FoundVal && "Key already in new map?");
301301 DestBucket->getFirst() = std::move(B->getFirst());
302 new (&DestBucket->getSecond()) ValueT(std::move(B->getSecond()));
302 ::new (&DestBucket->getSecond()) ValueT(std::move(B->getSecond()));
303303 incrementNumEntries();
304304
305305 // Free the value.
323323 getNumBuckets() * sizeof(BucketT));
324324 else
325325 for (size_t i = 0; i < getNumBuckets(); ++i) {
326 new (&getBuckets()[i].getFirst())
326 ::new (&getBuckets()[i].getFirst())
327327 KeyT(other.getBuckets()[i].getFirst());
328328 if (!KeyInfoT::isEqual(getBuckets()[i].getFirst(), getEmptyKey()) &&
329329 !KeyInfoT::isEqual(getBuckets()[i].getFirst(), getTombstoneKey()))
330 new (&getBuckets()[i].getSecond())
330 ::new (&getBuckets()[i].getSecond())
331331 ValueT(other.getBuckets()[i].getSecond());
332332 }
333333 }
401401 TheBucket = InsertIntoBucketImpl(Key, TheBucket);
402402
403403 TheBucket->getFirst() = Key;
404 new (&TheBucket->getSecond()) ValueT(Value);
404 ::new (&TheBucket->getSecond()) ValueT(Value);
405405 return TheBucket;
406406 }
407407
410410 TheBucket = InsertIntoBucketImpl(Key, TheBucket);
411411
412412 TheBucket->getFirst() = Key;
413 new (&TheBucket->getSecond()) ValueT(std::move(Value));
413 ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
414414 return TheBucket;
415415 }
416416
418418 TheBucket = InsertIntoBucketImpl(Key, TheBucket);
419419
420420 TheBucket->getFirst() = std::move(Key);
421 new (&TheBucket->getSecond()) ValueT(std::move(Value));
421 ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
422422 return TheBucket;
423423 }
424424
765765 // Swap separately and handle any assymetry.
766766 std::swap(LHSB->getFirst(), RHSB->getFirst());
767767 if (hasLHSValue) {
768 new (&RHSB->getSecond()) ValueT(std::move(LHSB->getSecond()));
768 ::new (&RHSB->getSecond()) ValueT(std::move(LHSB->getSecond()));
769769 LHSB->getSecond().~ValueT();
770770 } else if (hasRHSValue) {
771 new (&LHSB->getSecond()) ValueT(std::move(RHSB->getSecond()));
771 ::new (&LHSB->getSecond()) ValueT(std::move(RHSB->getSecond()));
772772 RHSB->getSecond().~ValueT();
773773 }
774774 }
794794 for (unsigned i = 0, e = InlineBuckets; i != e; ++i) {
795795 BucketT *NewB = &LargeSide.getInlineBuckets()[i],
796796 *OldB = &SmallSide.getInlineBuckets()[i];
797 new (&NewB->getFirst()) KeyT(std::move(OldB->getFirst()));
797 ::new (&NewB->getFirst()) KeyT(std::move(OldB->getFirst()));
798798 OldB->getFirst().~KeyT();
799799 if (!KeyInfoT::isEqual(NewB->getFirst(), EmptyKey) &&
800800 !KeyInfoT::isEqual(NewB->getFirst(), TombstoneKey)) {
801 new (&NewB->getSecond()) ValueT(std::move(OldB->getSecond()));
801 ::new (&NewB->getSecond()) ValueT(std::move(OldB->getSecond()));
802802 OldB->getSecond().~ValueT();
803803 }
804804 }
865865 !KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {
866866 assert(size_t(TmpEnd - TmpBegin) < InlineBuckets &&
867867 "Too many inline buckets!");
868 new (&TmpEnd->getFirst()) KeyT(std::move(P->getFirst()));
869 new (&TmpEnd->getSecond()) ValueT(std::move(P->getSecond()));
868 ::new (&TmpEnd->getFirst()) KeyT(std::move(P->getFirst()));
869 ::new (&TmpEnd->getSecond()) ValueT(std::move(P->getSecond()));
870870 ++TmpEnd;
871871 P->getSecond().~ValueT();
872872 }