[llvm] 637a24b - Revert "Replace std::foo with std::foo_t in LLVM."

Vladimir Vereschaka via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 20:54:53 PST 2020


Author: Vladimir Vereschaka
Date: 2020-02-12T20:54:21-08:00
New Revision: 637a24bc0c307519384930834febdb6a7875274e

URL: https://github.com/llvm/llvm-project/commit/637a24bc0c307519384930834febdb6a7875274e
DIFF: https://github.com/llvm/llvm-project/commit/637a24bc0c307519384930834febdb6a7875274e.diff

LOG: Revert "Replace std::foo with std::foo_t in LLVM."

This reverts commit a4384c756bd8a819051009b5b273b2a34be8261b.

These changes break LLVM build on Windows builders.

See https://reviews.llvm.org/rGa4384c756bd8a819051009b5b273b2a34be8261b
for details.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/DenseMap.h
    llvm/include/llvm/ADT/FunctionExtras.h
    llvm/include/llvm/ADT/ImmutableList.h
    llvm/include/llvm/ADT/STLExtras.h
    llvm/include/llvm/ADT/ScopeExit.h
    llvm/include/llvm/ADT/SmallVector.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index 6bc72341cf38..b73afae4bce6 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -1164,7 +1164,8 @@ class DenseMapIterator : DebugEpochBase::HandleBase {
 
 public:
   using 
diff erence_type = ptr
diff _t;
-  using value_type = std::conditional_t<IsConst, const Bucket, Bucket>;
+  using value_type =
+      typename std::conditional<IsConst, const Bucket, Bucket>::type;
   using pointer = value_type *;
   using reference = value_type &;
   using iterator_category = std::forward_iterator_tag;

diff  --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
index caed60efefa7..121aa527a5da 100644
--- a/llvm/include/llvm/ADT/FunctionExtras.h
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
@@ -62,12 +62,12 @@ class unique_function<ReturnT(ParamTs...)> {
   // It doesn't have to be exact though, and in one way it is more strict
   // because we want to still be able to observe either moves *or* copies.
   template <typename T>
-  using AdjustedParamT =
-      std::conditional_t<!std::is_reference<T>::value &&
-                             llvm::is_trivially_copy_constructible<T>::value &&
-                             llvm::is_trivially_move_constructible<T>::value &&
-                             IsSizeLessThanThresholdT<T>::value,
-                         T, T &>;
+  using AdjustedParamT = typename std::conditional<
+      !std::is_reference<T>::value &&
+          llvm::is_trivially_copy_constructible<T>::value &&
+          llvm::is_trivially_move_constructible<T>::value &&
+          IsSizeLessThanThresholdT<T>::value,
+      T, T &>::type;
 
   // The type of the erased function pointer we use as a callback to dispatch to
   // the stored callable when it is trivial to move and destroy.
@@ -112,7 +112,8 @@ class unique_function<ReturnT(ParamTs...)> {
 
     // For in-line storage, we just provide an aligned character buffer. We
     // provide three pointers worth of storage here.
-    std::aligned_storage_t<InlineStorageSize, alignof(void *)> InlineStorage;
+    typename std::aligned_storage<InlineStorageSize, alignof(void *)>::type
+        InlineStorage;
   } StorageUnion;
 
   // A compressed pointer to either our dispatching callback or our table of

diff  --git a/llvm/include/llvm/ADT/ImmutableList.h b/llvm/include/llvm/ADT/ImmutableList.h
index aa672c315a2f..c9ee494734e7 100644
--- a/llvm/include/llvm/ADT/ImmutableList.h
+++ b/llvm/include/llvm/ADT/ImmutableList.h
@@ -93,7 +93,7 @@ class ImmutableList {
     bool operator==(const iterator& I) const { return L == I.L; }
     bool operator!=(const iterator& I) const { return L != I.L; }
     const value_type& operator*() const { return L->getHead(); }
-    const std::remove_reference_t<value_type> *operator->() const {
+    const typename std::remove_reference<value_type>::type* operator->() const {
       return &L->getHead();
     }
 

diff  --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 3bb773cb35f7..8888e8d48978 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -63,14 +63,16 @@ template <typename...> struct conjunction : std::true_type {};
 template <typename B1> struct conjunction<B1> : B1 {};
 template <typename B1, typename... Bn>
 struct conjunction<B1, Bn...>
-    : std::conditional_t<bool(B1::value), conjunction<Bn...>, B1> {};
+    : std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
 
 template <typename T> struct make_const_ptr {
-  using type = std::add_pointer_t<std::add_const_t<T>>;
+  using type =
+      typename std::add_pointer<typename std::add_const<T>::type>::type;
 };
 
 template <typename T> struct make_const_ref {
-  using type = std::add_lvalue_reference_t<std::add_const_t<T>>;
+  using type = typename std::add_lvalue_reference<
+      typename std::add_const<T>::type>::type;
 };
 
 //===----------------------------------------------------------------------===//
@@ -115,7 +117,7 @@ class function_ref<Ret(Params...)> {
   function_ref(Callable &&callable,
                std::enable_if_t<!std::is_same<std::remove_reference_t<Callable>,
                                               function_ref>::value> * = nullptr)
-      : callback(callback_fn<std::remove_reference_t<Callable>>),
+      : callback(callback_fn<typename std::remove_reference<Callable>::type>),
         callable(reinterpret_cast<intptr_t>(&callable)) {}
 
   Ret operator()(Params ...params) const {
@@ -198,12 +200,12 @@ template <typename T> auto drop_begin(T &&RangeOrContainer, size_t N) {
 
 template <typename ItTy, typename FuncTy,
           typename FuncReturnTy =
-              decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
+            decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
 class mapped_iterator
     : public iterator_adaptor_base<
-          mapped_iterator<ItTy, FuncTy>, ItTy,
-          typename std::iterator_traits<ItTy>::iterator_category,
-          std::remove_reference_t<FuncReturnTy>> {
+             mapped_iterator<ItTy, FuncTy>, ItTy,
+             typename std::iterator_traits<ItTy>::iterator_category,
+             typename std::remove_reference<FuncReturnTy>::type> {
 public:
   mapped_iterator(ItTy U, FuncTy F)
     : mapped_iterator::iterator_adaptor_base(std::move(U)), F(std::move(F)) {}
@@ -245,7 +247,8 @@ template <typename Ty> class has_rbegin_impl {
 
 /// Metafunction to determine if T& or T has a member called rbegin().
 template <typename Ty>
-struct has_rbegin : has_rbegin_impl<std::remove_reference_t<Ty>> {};
+struct has_rbegin : has_rbegin_impl<typename std::remove_reference<Ty>::type> {
+};
 
 // Returns an iterator_range over the given container which iterates in reverse.
 // Note that the container must have rbegin()/rend() methods for this to work.
@@ -292,14 +295,15 @@ class filter_iterator_base
     : public iterator_adaptor_base<
           filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
           WrappedIteratorT,
-          std::common_type_t<IterTag,
-                             typename std::iterator_traits<
-                                 WrappedIteratorT>::iterator_category>> {
+          typename std::common_type<
+              IterTag, typename std::iterator_traits<
+                           WrappedIteratorT>::iterator_category>::type> {
   using BaseT = iterator_adaptor_base<
       filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
       WrappedIteratorT,
-      std::common_type_t<IterTag, typename std::iterator_traits<
-                                      WrappedIteratorT>::iterator_category>>;
+      typename std::common_type<
+          IterTag, typename std::iterator_traits<
+                       WrappedIteratorT>::iterator_category>::type>;
 
 protected:
   WrappedIteratorT End;
@@ -517,10 +521,9 @@ template<typename... Iters> struct ZipTupleType {
 
 template <typename ZipType, typename... Iters>
 using zip_traits = iterator_facade_base<
-    ZipType,
-    std::common_type_t<
-        std::bidirectional_iterator_tag,
-        typename std::iterator_traits<Iters>::iterator_category...>,
+    ZipType, typename std::common_type<std::bidirectional_iterator_tag,
+                                       typename std::iterator_traits<
+                                           Iters>::iterator_category...>::type,
     // ^ TODO: Implement random access methods.
     typename ZipTupleType<Iters...>::type,
     typename std::iterator_traits<typename std::tuple_element<
@@ -672,8 +675,9 @@ static auto deref_or_none(const Iter &I, const Iter &End) -> llvm::Optional<
 }
 
 template <typename Iter> struct ZipLongestItemType {
-  using type = llvm::Optional<std::remove_const_t<
-      std::remove_reference_t<decltype(*std::declval<Iter>())>>>;
+  using type =
+      llvm::Optional<typename std::remove_const<typename std::remove_reference<
+          decltype(*std::declval<Iter>())>::type>::type>;
 };
 
 template <typename... Iters> struct ZipLongestTupleType {
@@ -684,12 +688,12 @@ template <typename... Iters>
 class zip_longest_iterator
     : public iterator_facade_base<
           zip_longest_iterator<Iters...>,
-          std::common_type_t<
+          typename std::common_type<
               std::forward_iterator_tag,
-              typename std::iterator_traits<Iters>::iterator_category...>,
+              typename std::iterator_traits<Iters>::iterator_category...>::type,
           typename ZipLongestTupleType<Iters...>::type,
-          typename std::iterator_traits<
-              std::tuple_element_t<0, std::tuple<Iters...>>>::
diff erence_type,
+          typename std::iterator_traits<typename std::tuple_element<
+              0, std::tuple<Iters...>>::type>::
diff erence_type,
           typename ZipLongestTupleType<Iters...>::type *,
           typename ZipLongestTupleType<Iters...>::type> {
 public:
@@ -1497,8 +1501,8 @@ decltype(auto) apply_tuple_impl(F &&f, Tuple &&t, std::index_sequence<I...>) {
 /// return the result.
 template <typename F, typename Tuple>
 decltype(auto) apply_tuple(F &&f, Tuple &&t) {
-  using Indices =
-      std::make_index_sequence<std::tuple_size<std::decay_t<Tuple>>::value>;
+  using Indices = std::make_index_sequence<
+      std::tuple_size<typename std::decay<Tuple>::type>::value>;
 
   return detail::apply_tuple_impl(std::forward<F>(f), std::forward<Tuple>(t),
                                   Indices{});

diff  --git a/llvm/include/llvm/ADT/ScopeExit.h b/llvm/include/llvm/ADT/ScopeExit.h
index 4e52d969d616..712d91237739 100644
--- a/llvm/include/llvm/ADT/ScopeExit.h
+++ b/llvm/include/llvm/ADT/ScopeExit.h
@@ -54,9 +54,10 @@ template <typename Callable> class scope_exit {
 //
 // Interface is specified by p0052r2.
 template <typename Callable>
-LLVM_NODISCARD detail::scope_exit<std::decay_t<Callable>>
+LLVM_NODISCARD detail::scope_exit<typename std::decay<Callable>::type>
 make_scope_exit(Callable &&F) {
-  return detail::scope_exit<std::decay_t<Callable>>(std::forward<Callable>(F));
+  return detail::scope_exit<typename std::decay<Callable>::type>(
+      std::forward<Callable>(F));
 }
 
 } // end namespace llvm

diff  --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index bcec1720760b..28b514d530dc 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -284,8 +284,8 @@ class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
   template <typename T1, typename T2>
   static void uninitialized_copy(
       T1 *I, T1 *E, T2 *Dest,
-      std::enable_if_t<std::is_same<std::remove_const_t<T1>, T2>::value> * =
-          nullptr) {
+      std::enable_if_t<std::is_same<typename std::remove_const<T1>::type,
+                                    T2>::value> * = nullptr) {
     // Use memcpy for PODs iterated by pointers (which includes SmallVector
     // iterators): std::uninitialized_copy optimizes to memmove, but we can
     // use memcpy here. Note that I and E are iterators and thus might be
@@ -911,8 +911,8 @@ inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
 /// SmallVector with elements of the vector.  This is useful, for example,
 /// when you want to iterate a range and then sort the results.
 template <unsigned Size, typename R>
-SmallVector<std::remove_const_t<std::remove_reference_t<
-                decltype(*std::begin(std::declval<R &>()))>>,
+SmallVector<typename std::remove_const<typename std::remove_reference<
+                decltype(*std::begin(std::declval<R &>()))>::type>::type,
             Size>
 to_vector(R &&Range) {
   return {std::begin(Range), std::end(Range)};


        


More information about the llvm-commits mailing list