llvm::deallocate_buffer, dataIsMutable);
}
/// Create a new heap allocated blob and copy the provided data into it.
- static AsmResourceBlob allocateAndCopy(ArrayRef<char> data, size_t align,
- bool dataIsMutable = true) {
+ static AsmResourceBlob allocateAndCopyWithAlign(ArrayRef<char> data,
+ size_t align,
+ bool dataIsMutable = true) {
AsmResourceBlob blob = allocate(data.size(), align, dataIsMutable);
std::memcpy(blob.getMutableData().data(), data.data(), data.size());
return blob;
}
template <typename T>
- static std::enable_if_t<!std::is_same<T, char>::value, AsmResourceBlob>
- allocateAndCopy(ArrayRef<T> data, bool dataIsMutable = true) {
- return allocateAndCopy(
+ static AsmResourceBlob allocateAndCopyInferAlign(ArrayRef<T> data,
+ bool dataIsMutable = true) {
+ return allocateAndCopyWithAlign(
ArrayRef<char>((const char *)data.data(), data.size() * sizeof(T)),
- alignof(T));
+ alignof(T), dataIsMutable);
}
};
/// This class provides a simple utility wrapper for creating "unmanaged"