mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Update LLVM libraries to 14.0.6 (#4350)
The main noticeable change is the SmallString conversion operator to std::string is now explicit instead of implicit.
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
From 1c3e8a6ff8d8b6c054141503c7318d69319d8d41 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:42:09 -0400
|
||||
Subject: [PATCH 18/28] Use std::is_trivially_copy_constructible
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/PointerIntPair.h | 12 ----
|
||||
llvm/include/llvm/Support/type_traits.h | 91 +------------------------
|
||||
2 files changed, 2 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
index b7ddf8855..a48fb904b 100644
|
||||
--- a/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
+++ b/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
@@ -128,18 +128,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
-// Specialize is_trivially_copyable to avoid limitation of llvm::is_trivially_copyable
|
||||
-// when compiled with gcc 4.9.
|
||||
-template <typename PointerTy, unsigned IntBits, typename IntType,
|
||||
- typename PtrTraits,
|
||||
- typename Info>
|
||||
-struct is_trivially_copyable<PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>> : std::true_type {
|
||||
-#ifdef HAVE_STD_IS_TRIVIALLY_COPYABLE
|
||||
- static_assert(std::is_trivially_copyable<PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>>::value,
|
||||
- "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable");
|
||||
-#endif
|
||||
-};
|
||||
-
|
||||
|
||||
template <typename PointerT, unsigned IntBits, typename PtrTraits>
|
||||
struct PointerIntPairInfo {
|
||||
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
|
||||
index 7b7d5d991..72a2e84ad 100644
|
||||
--- a/llvm/include/llvm/Support/type_traits.h
|
||||
+++ b/llvm/include/llvm/Support/type_traits.h
|
||||
@@ -92,98 +92,11 @@ union trivial_helper {
|
||||
|
||||
} // end namespace detail
|
||||
|
||||
-/// An implementation of `std::is_trivially_copy_constructible` since we have
|
||||
-/// users with STLs that don't yet include it.
|
||||
template <typename T>
|
||||
-struct is_trivially_copy_constructible
|
||||
- : std::is_copy_constructible<
|
||||
- ::llvm::detail::copy_construction_triviality_helper<T>> {};
|
||||
-template <typename T>
|
||||
-struct is_trivially_copy_constructible<T &> : std::true_type {};
|
||||
-template <typename T>
|
||||
-struct is_trivially_copy_constructible<T &&> : std::false_type {};
|
||||
+using is_trivially_move_constructible = std::is_trivially_move_constructible<T>;
|
||||
|
||||
-/// An implementation of `std::is_trivially_move_constructible` since we have
|
||||
-/// users with STLs that don't yet include it.
|
||||
-template <typename T>
|
||||
-struct is_trivially_move_constructible
|
||||
- : std::is_move_constructible<
|
||||
- ::llvm::detail::move_construction_triviality_helper<T>> {};
|
||||
template <typename T>
|
||||
-struct is_trivially_move_constructible<T &> : std::true_type {};
|
||||
-template <typename T>
|
||||
-struct is_trivially_move_constructible<T &&> : std::true_type {};
|
||||
-
|
||||
-
|
||||
-template <typename T>
|
||||
-struct is_copy_assignable {
|
||||
- template<class F>
|
||||
- static auto get(F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
|
||||
- static std::false_type get(...);
|
||||
- static constexpr bool value = decltype(get((T*)nullptr))::value;
|
||||
-};
|
||||
-
|
||||
-template <typename T>
|
||||
-struct is_move_assignable {
|
||||
- template<class F>
|
||||
- static auto get(F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
|
||||
- static std::false_type get(...);
|
||||
- static constexpr bool value = decltype(get((T*)nullptr))::value;
|
||||
-};
|
||||
-
|
||||
-
|
||||
-// An implementation of `std::is_trivially_copyable` since STL version
|
||||
-// is not equally supported by all compilers, especially GCC 4.9.
|
||||
-// Uniform implementation of this trait is important for ABI compatibility
|
||||
-// as it has an impact on SmallVector's ABI (among others).
|
||||
-template <typename T>
|
||||
-class is_trivially_copyable {
|
||||
-
|
||||
- // copy constructors
|
||||
- static constexpr bool has_trivial_copy_constructor =
|
||||
- std::is_copy_constructible<detail::trivial_helper<T>>::value;
|
||||
- static constexpr bool has_deleted_copy_constructor =
|
||||
- !std::is_copy_constructible<T>::value;
|
||||
-
|
||||
- // move constructors
|
||||
- static constexpr bool has_trivial_move_constructor =
|
||||
- std::is_move_constructible<detail::trivial_helper<T>>::value;
|
||||
- static constexpr bool has_deleted_move_constructor =
|
||||
- !std::is_move_constructible<T>::value;
|
||||
-
|
||||
- // copy assign
|
||||
- static constexpr bool has_trivial_copy_assign =
|
||||
- is_copy_assignable<detail::trivial_helper<T>>::value;
|
||||
- static constexpr bool has_deleted_copy_assign =
|
||||
- !is_copy_assignable<T>::value;
|
||||
-
|
||||
- // move assign
|
||||
- static constexpr bool has_trivial_move_assign =
|
||||
- is_move_assignable<detail::trivial_helper<T>>::value;
|
||||
- static constexpr bool has_deleted_move_assign =
|
||||
- !is_move_assignable<T>::value;
|
||||
-
|
||||
- // destructor
|
||||
- static constexpr bool has_trivial_destructor =
|
||||
- std::is_destructible<detail::trivial_helper<T>>::value;
|
||||
-
|
||||
- public:
|
||||
-
|
||||
- static constexpr bool value =
|
||||
- has_trivial_destructor &&
|
||||
- (has_deleted_move_assign || has_trivial_move_assign) &&
|
||||
- (has_deleted_move_constructor || has_trivial_move_constructor) &&
|
||||
- (has_deleted_copy_assign || has_trivial_copy_assign) &&
|
||||
- (has_deleted_copy_constructor || has_trivial_copy_constructor);
|
||||
-
|
||||
-#ifdef HAVE_STD_IS_TRIVIALLY_COPYABLE
|
||||
- static_assert(value == std::is_trivially_copyable<T>::value,
|
||||
- "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable");
|
||||
-#endif
|
||||
-};
|
||||
-template <typename T>
|
||||
-class is_trivially_copyable<T*> : public std::true_type {
|
||||
-};
|
||||
+using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
|
||||
|
||||
|
||||
} // end namespace llvm
|
||||
Reference in New Issue
Block a user