summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2016-03-27 20:50:05 +0000
committerJF Bastien <jfb@google.com>2016-03-27 20:50:05 +0000
commitbaf4459b8be1ae2f17b76701fb9aeaea0e2281ce (patch)
tree3fc268ce930af41ef0bc6fd0f4a994b49a984ef6
parent1768117d1a4a30d8c4d79827f5abd26efc1bea39 (diff)
downloadbcm5719-llvm-baf4459b8be1ae2f17b76701fb9aeaea0e2281ce.tar.gz
bcm5719-llvm-baf4459b8be1ae2f17b76701fb9aeaea0e2281ce.zip
Revert "isPodLike: more precise"
This reverts commit c45f2afac5d6855a4804456a0f718563dc47ada0. Looks like it may be causing a failure, I'll revert for now. from lib/CodeGen/AsmPrinter/DwarfDebug.cpp:14: /usr/include/c++/4.9.2/bits/stl_pair.h: In instantiation of 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = std::unique_ptr<llvm::DwarfTypeUnit>; _T2 = const llvm::DICompositeType*]': /usr/include/c++/4.9.2/bits/stl_pair.h:160:8: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = llvm::DwarfTypeUnit; _Dp = std::default_delete<llvm::DwarfTypeUnit>]' first = __p.first; ^ llvm-svn: 264544
-rw-r--r--llvm/include/llvm/Support/type_traits.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
index 468dc6ce440..88385c3fae1 100644
--- a/llvm/include/llvm/Support/type_traits.h
+++ b/llvm/include/llvm/Support/type_traits.h
@@ -24,11 +24,12 @@
namespace llvm {
-/// Type trait used to determine whether a given type can be copied around with
-/// memcpy instead of running ctors.
-template <typename T> struct isPodLike {
-// std::is_trivially_copyable is available in libc++ with clang, libstdc++
-// that comes with GCC 5.
+/// isPodLike - This is a type trait that is used to determine whether a given
+/// type can be copied around with memcpy instead of running ctors etc.
+template <typename T>
+struct isPodLike {
+ // std::is_trivially_copyable is available in libc++ with clang, libstdc++
+ // that comes with GCC 5.
#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
(defined(__GNUC__) && __GNUC__ >= 5)
// If the compiler supports the is_trivially_copyable trait use it, as it
@@ -39,15 +40,10 @@ template <typename T> struct isPodLike {
// don't know if the standard library does. This is the case for clang in
// conjunction with libstdc++ from GCC 4.x.
static const bool value = __is_trivially_copyable(T);
-#elif defined(__GNUC__)
- // Fallback to ye olden compiler intrinsic, which isn't as accurate as the new
- // one but more widely supported.
- static const bool value = __has_trivial_copy(T);
#else
- // If we really don't know anything else is_pod will do, is widely supported,
- // but is too strict (e.g. a user-defined ctor doesn't prevent trivial copy
- // but prevents POD-ness).
- static const bool value = std::is_pod<T>::value;
+ // If we don't know anything else, we can (at least) assume that all non-class
+ // types are PODs.
+ static const bool value = !std::is_class<T>::value;
#endif
};
OpenPOWER on IntegriCloud