diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -59,7 +59,7 @@ template using EnableIfTrivial = - std::enable_if_t::value && + std::enable_if_t::value && std::is_trivially_destructible::value>; template using EnableUnlessSameType = @@ -100,8 +100,8 @@ static_assert(!std::is_reference::value, "references should be handled by template specialization"); using type = typename std::conditional< - llvm::is_trivially_copy_constructible::value && - llvm::is_trivially_move_constructible::value && + std::is_trivially_copy_constructible::value && + std::is_trivially_move_constructible::value && IsSizeLessThanThresholdT::value, T, T &>::type; }; diff --git a/llvm/include/llvm/ADT/Optional.h b/llvm/include/llvm/ADT/Optional.h --- a/llvm/include/llvm/ADT/Optional.h +++ b/llvm/include/llvm/ADT/Optional.h @@ -50,13 +50,12 @@ // // The move constructible / assignable conditions emulate the remaining behavior // of std::is_trivially_copyable. -template ::value && - std::is_trivially_copy_assignable::value && - (llvm::is_trivially_move_constructible::value || - !std::is_move_constructible::value) && - (std::is_trivially_move_assignable::value || - !std::is_move_assignable::value))> +template ::value && + std::is_trivially_copy_assignable::value && + (std::is_trivially_move_constructible::value || + !std::is_move_constructible::value) && + (std::is_trivially_move_assignable::value || + !std::is_move_assignable::value))> class OptionalStorage { union { char empty; diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -312,8 +312,8 @@ /// copy these types with memcpy, there is no way for the type to observe this. /// This catches the important case of std::pair, which is not /// trivially assignable. -template ::value) && - (is_trivially_move_constructible::value) && +template ::value) && + (std::is_trivially_move_constructible::value) && std::is_trivially_destructible::value> class SmallVectorTemplateBase : public SmallVectorTemplateCommon { friend class SmallVectorTemplateCommon; diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h --- a/llvm/include/llvm/Support/type_traits.h +++ b/llvm/include/llvm/Support/type_traits.h @@ -70,21 +70,6 @@ }; namespace detail { -/// Internal utility to detect trivial copy construction. -template union copy_construction_triviality_helper { - T t; - copy_construction_triviality_helper() = default; - copy_construction_triviality_helper(const copy_construction_triviality_helper&) = default; - ~copy_construction_triviality_helper() = default; -}; -/// Internal utility to detect trivial move construction. -template union move_construction_triviality_helper { - T t; - move_construction_triviality_helper() = default; - move_construction_triviality_helper(move_construction_triviality_helper&&) = default; - ~move_construction_triviality_helper() = default; -}; - template union trivial_helper { T t; @@ -92,29 +77,6 @@ } // end namespace detail -/// An implementation of `std::is_trivially_copy_constructible` since we have -/// users with STLs that don't yet include it. -template -struct is_trivially_copy_constructible - : std::is_copy_constructible< - ::llvm::detail::copy_construction_triviality_helper> {}; -template -struct is_trivially_copy_constructible : std::true_type {}; -template -struct is_trivially_copy_constructible : std::false_type {}; - -/// An implementation of `std::is_trivially_move_constructible` since we have -/// users with STLs that don't yet include it. -template -struct is_trivially_move_constructible - : std::is_move_constructible< - ::llvm::detail::move_construction_triviality_helper> {}; -template -struct is_trivially_move_constructible : std::true_type {}; -template -struct is_trivially_move_constructible : std::true_type {}; - - template struct is_copy_assignable { template diff --git a/llvm/unittests/Support/TypeTraitsTest.cpp b/llvm/unittests/Support/TypeTraitsTest.cpp --- a/llvm/unittests/Support/TypeTraitsTest.cpp +++ b/llvm/unittests/Support/TypeTraitsTest.cpp @@ -26,10 +26,10 @@ template void TrivialityTester() { - static_assert(llvm::is_trivially_copy_constructible::value == + static_assert(std::is_trivially_copy_constructible::value == IsTriviallyCopyConstructible, "Mismatch in expected trivial copy construction!"); - static_assert(llvm::is_trivially_move_constructible::value == + static_assert(std::is_trivially_move_constructible::value == IsTriviallyMoveConstructible, "Mismatch in expected trivial move construction!");