llvm.org GIT mirror llvm / 425788d
Fix few g++ 8 warning with non obvious copy object operations Reviewers: dblaikie, dexonsmith Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D50296 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339367 91177308-0d34-0410-b5e6-96231b3b80d8 David Carlier 1 year, 10 months ago
2 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
392392 setNumTombstones(other.getNumTombstones());
393393
394394 if (isPodLike::value && isPodLike::value)
395 memcpy(getBuckets(), other.getBuckets(),
395 memcpy(reinterpret_cast(getBuckets()), other.getBuckets(),
396396 getNumBuckets() * sizeof(BucketT));
397397 else
398398 for (size_t i = 0; i < getNumBuckets(); ++i) {
298298 // use memcpy here. Note that I and E are iterators and thus might be
299299 // invalid for memcpy if they are equal.
300300 if (I != E)
301 memcpy(Dest, I, (E - I) * sizeof(T));
301 memcpy(reinterpret_cast(Dest), I, (E - I) * sizeof(T));
302302 }
303303
304304 /// Double the size of the allocated memory, guaranteeing space for at
309309 void push_back(const T &Elt) {
310310 if (LLVM_UNLIKELY(this->size() >= this->capacity()))
311311 this->grow();
312 memcpy(this->end(), &Elt, sizeof(T));
312 memcpy(reinterpret_cast(this->end()), &Elt, sizeof(T));
313313 this->set_size(this->size() + 1);
314314 }
315315