From a0a840a4318e042af853bfe92e601ce3a18af9f0 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sat, 18 Feb 2017 01:46:01 +0000 Subject: [PATCH] Use llvm workaround for missing is_trivially_copyable. some versions of GCC don't have this, so LLVM provides a workaround. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295526 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/MSF/StreamReader.h | 8 +++++--- include/llvm/DebugInfo/MSF/StreamWriter.h | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/llvm/DebugInfo/MSF/StreamReader.h b/include/llvm/DebugInfo/MSF/StreamReader.h index 01261226c2a..719a26def08 100644 --- a/include/llvm/DebugInfo/MSF/StreamReader.h +++ b/include/llvm/DebugInfo/MSF/StreamReader.h @@ -17,8 +17,10 @@ #include "llvm/DebugInfo/MSF/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" +#include "llvm/Support/type_traits.h" #include +#include namespace llvm { namespace msf { @@ -63,7 +65,7 @@ public: } template Error readObject(const T *&Dest) { - static_assert(std::is_trivially_copyable::value, + static_assert(isPodLike::value, "Can only read trivially copyable object types!"); ArrayRef Buffer; if (auto EC = readBytes(Buffer, sizeof(T))) @@ -74,7 +76,7 @@ public: template Error readArray(ArrayRef &Array, uint32_t NumElements) { - static_assert(std::is_trivially_copyable::value, + static_assert(isPodLike::value, "Can only read trivially copyable object types!"); ArrayRef Bytes; if (NumElements == 0) { @@ -102,7 +104,7 @@ public: template Error readArray(FixedStreamArray &Array, uint32_t NumItems) { - static_assert(std::is_trivially_copyable::value, + static_assert(isPodLike::value, "Can only read trivially copyable object types!"); if (NumItems == 0) { Array = FixedStreamArray(); diff --git a/include/llvm/DebugInfo/MSF/StreamWriter.h b/include/llvm/DebugInfo/MSF/StreamWriter.h index 87af18f0206..69bb5505efb 100644 --- a/include/llvm/DebugInfo/MSF/StreamWriter.h +++ b/include/llvm/DebugInfo/MSF/StreamWriter.h @@ -17,6 +17,7 @@ #include "llvm/DebugInfo/MSF/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" +#include "llvm/Support/type_traits.h" #include #include @@ -61,14 +62,14 @@ public: "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::value, + static_assert(isPodLike::value, "Can only serialize trivially copyable object types"); return writeBytes( ArrayRef(reinterpret_cast(&Obj), sizeof(T))); } template Error writeArray(ArrayRef Array) { - static_assert(std::is_trivially_copyable::value, + static_assert(isPodLike::value, "Can only serialize trivially copyable object types"); if (Array.empty()) return Error::success(); @@ -87,7 +88,7 @@ public: } template Error writeArray(FixedStreamArray Array) { - static_assert(std::is_trivially_copyable::value, + static_assert(isPodLike::value, "Can only serialize trivially copyable object types"); return writeStreamRef(Array.getUnderlyingStream()); } -- 2.40.0