summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2018-11-30 22:13:42 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2018-11-30 22:13:42 +0000
commit5842df93dd3fd70ab1ca5ba9ed6b4010c233f330 (patch)
tree5410fc14f0f91d42a45718e5877676e93e21ddce
parent0b32e44eff39fe69443fa0c49507d1c218a4bffa (diff)
downloadbcm5719-llvm-5842df93dd3fd70ab1ca5ba9ed6b4010c233f330.tar.gz
bcm5719-llvm-5842df93dd3fd70ab1ca5ba9ed6b4010c233f330.zip
Support: use std::is_trivially_copyable on MSVC
MSVC 2015 and newer have std::is_trivially_copyable available for use. We should prefer that over the std::is_class to get this check be correct. llvm-svn: 348042
-rw-r--r--llvm/include/llvm/Support/type_traits.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
index 55d84f138f0..e7b8f2517b8 100644
--- a/llvm/include/llvm/Support/type_traits.h
+++ b/llvm/include/llvm/Support/type_traits.h
@@ -30,9 +30,10 @@ namespace llvm {
template <typename T>
struct isPodLike {
// std::is_trivially_copyable is available in libc++ with clang, libstdc++
- // that comes with GCC 5.
+ // that comes with GCC 5. MSVC 2015 and newer also have
+ // std::is_trivially_copyable.
#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
- (defined(__GNUC__) && __GNUC__ >= 5)
+ (defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER)
// If the compiler supports the is_trivially_copyable trait use it, as it
// matches the definition of isPodLike closely.
static const bool value = std::is_trivially_copyable<T>::value;
OpenPOWER on IntegriCloud