|
| 1 | +diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h |
| 2 | +index 0093c281aac8..ad131015a7d9 100644 |
| 3 | +--- a/llvm/include/llvm/ADT/Hashing.h |
| 4 | ++++ b/llvm/include/llvm/ADT/Hashing.h |
| 5 | +@@ -136,7 +136,7 @@ namespace detail { |
| 6 | + |
| 7 | + inline uint64_t fetch64(const char *p) { |
| 8 | + uint64_t result; |
| 9 | +- memcpy(&result, p, sizeof(result)); |
| 10 | ++ std::memcpy(&result, p, sizeof(result)); |
| 11 | + if (sys::IsBigEndianHost) |
| 12 | + sys::swapByteOrder(result); |
| 13 | + return result; |
| 14 | +@@ -144,7 +144,7 @@ inline uint64_t fetch64(const char *p) { |
| 15 | + |
| 16 | + inline uint32_t fetch32(const char *p) { |
| 17 | + uint32_t result; |
| 18 | +- memcpy(&result, p, sizeof(result)); |
| 19 | ++ std::memcpy(&result, p, sizeof(result)); |
| 20 | + if (sys::IsBigEndianHost) |
| 21 | + sys::swapByteOrder(result); |
| 22 | + return result; |
| 23 | +@@ -379,7 +379,7 @@ bool store_and_advance(char *&buffer_ptr, char *buffer_end, const T& value, |
| 24 | + if (buffer_ptr + store_size > buffer_end) |
| 25 | + return false; |
| 26 | + const char *value_data = reinterpret_cast<const char *>(&value); |
| 27 | +- memcpy(buffer_ptr, value_data + offset, store_size); |
| 28 | ++ std::memcpy(buffer_ptr, value_data + offset, store_size); |
| 29 | + buffer_ptr += store_size; |
| 30 | + return true; |
| 31 | + } |
| 32 | +@@ -513,7 +513,7 @@ public: |
| 33 | + // with the variadic combine because that formation can have varying |
| 34 | + // argument types. |
| 35 | + size_t partial_store_size = buffer_end - buffer_ptr; |
| 36 | +- memcpy(buffer_ptr, &data, partial_store_size); |
| 37 | ++ std::memcpy(buffer_ptr, &data, partial_store_size); |
| 38 | + |
| 39 | + // If the store fails, our buffer is full and ready to hash. We have to |
| 40 | + // either initialize the hash state (on the first full buffer) or mix |
| 41 | +diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h |
| 42 | +index 0b8bb48b8fe5..80f7734b8690 100644 |
| 43 | +--- a/llvm/include/llvm/ADT/SmallVector.h |
| 44 | ++++ b/llvm/include/llvm/ADT/SmallVector.h |
| 45 | +@@ -518,7 +518,7 @@ protected: |
| 46 | + // use memcpy here. Note that I and E are iterators and thus might be |
| 47 | + // invalid for memcpy if they are equal. |
| 48 | + if (I != E) |
| 49 | +- memcpy(reinterpret_cast<void *>(Dest), I, (E - I) * sizeof(T)); |
| 50 | ++ std::memcpy(reinterpret_cast<void *>(Dest), I, (E - I) * sizeof(T)); |
| 51 | + } |
| 52 | + |
| 53 | + /// Double the size of the allocated memory, guaranteeing space for at |
| 54 | +@@ -561,7 +561,7 @@ protected: |
| 55 | + public: |
| 56 | + void push_back(ValueParamT Elt) { |
| 57 | + const T *EltPtr = reserveForParamAndGetAddress(Elt); |
| 58 | +- memcpy(reinterpret_cast<void *>(this->end()), EltPtr, sizeof(T)); |
| 59 | ++ std::memcpy(reinterpret_cast<void *>(this->end()), EltPtr, sizeof(T)); |
| 60 | + this->set_size(this->size() + 1); |
| 61 | + } |
| 62 | + |
0 commit comments