#include "llvm/DebugInfo/MSF/StreamRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/type_traits.h"
#include <string>
+#include <type_traits>
namespace llvm {
namespace msf {
}
template <typename T> Error readObject(const T *&Dest) {
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only read trivially copyable object types!");
ArrayRef<uint8_t> Buffer;
if (auto EC = readBytes(Buffer, sizeof(T)))
template <typename T>
Error readArray(ArrayRef<T> &Array, uint32_t NumElements) {
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only read trivially copyable object types!");
ArrayRef<uint8_t> Bytes;
if (NumElements == 0) {
template <typename T>
Error readArray(FixedStreamArray<T> &Array, uint32_t NumItems) {
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only read trivially copyable object types!");
if (NumItems == 0) {
Array = FixedStreamArray<T>();
#include "llvm/DebugInfo/MSF/StreamRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/type_traits.h"
#include <cstdint>
#include <type_traits>
"writeObject should not be used with pointers, to write "
"the pointed-to value dereference the pointer before calling "
"writeObject");
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only serialize trivially copyable object types");
return writeBytes(
ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(&Obj), sizeof(T)));
}
template <typename T> Error writeArray(ArrayRef<T> Array) {
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only serialize trivially copyable object types");
if (Array.empty())
return Error::success();
}
template <typename T> Error writeArray(FixedStreamArray<T> Array) {
- static_assert(std::is_trivially_copyable<T>::value,
+ static_assert(isPodLike<T>::value,
"Can only serialize trivially copyable object types");
return writeStreamRef(Array.getUnderlyingStream());
}