[llvm] 3577e60 - [llvm] Remove redundaunt typename (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 15 12:12:15 PDT 2022


Author: Kazu Hirata
Date: 2022-10-15T12:11:59-07:00
New Revision: 3577e606dad0fa8f54e29e24673ff63bb7dfa880

URL: https://github.com/llvm/llvm-project/commit/3577e606dad0fa8f54e29e24673ff63bb7dfa880
DIFF: https://github.com/llvm/llvm-project/commit/3577e606dad0fa8f54e29e24673ff63bb7dfa880.diff

LOG: [llvm] Remove redundaunt typename (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/ADT/FoldingSet.h
    llvm/include/llvm/ADT/STLExtras.h
    llvm/include/llvm/ADT/Sequence.h
    llvm/include/llvm/ADT/TypeSwitch.h
    llvm/include/llvm/Support/TypeSize.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h
index ec276d41da80..237668921cbb 100644
--- a/llvm/include/llvm/ADT/FoldingSet.h
+++ b/llvm/include/llvm/ADT/FoldingSet.h
@@ -830,9 +830,9 @@ struct FoldingSetTrait<std::pair<T1, T2>> {
 };
 
 template <typename T>
-struct FoldingSetTrait<T, typename std::enable_if_t<std::is_enum<T>::value>> {
+struct FoldingSetTrait<T, std::enable_if_t<std::is_enum<T>::value>> {
   static void Profile(const T &X, FoldingSetNodeID &ID) {
-    ID.AddInteger(static_cast<typename std::underlying_type_t<T>>(X));
+    ID.AddInteger(static_cast<std::underlying_type_t<T>>(X));
   }
 };
 

diff  --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 5fa5c0b124bd..2c242b317470 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -1295,8 +1295,7 @@ namespace detail {
 /// always be a reference, to avoid returning a reference to a temporary.
 template <typename EltTy, typename FirstTy> class first_or_second_type {
 public:
-  using type =
-      typename std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
+  using type = std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
                                   std::remove_reference_t<FirstTy>>;
 };
 } // end namespace detail

diff  --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index 88a6fa920598..1153352d8b24 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -125,8 +125,8 @@ template <typename T, typename U> bool canTypeFitValue(const U Value) {
 // - its internal representation overflows.
 struct CheckedInt {
   // Integral constructor, asserts if Value cannot be represented as intmax_t.
-  template <typename Integral, typename std::enable_if_t<
-                                   std::is_integral<Integral>::value, bool> = 0>
+  template <typename Integral,
+            std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
   static CheckedInt from(Integral FromValue) {
     if (!canTypeFitValue<intmax_t>(FromValue))
       assertOutOfBounds();
@@ -137,7 +137,7 @@ struct CheckedInt {
 
   // Enum constructor, asserts if Value cannot be represented as intmax_t.
   template <typename Enum,
-            typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
+            std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
   static CheckedInt from(Enum FromValue) {
     using type = std::underlying_type_t<Enum>;
     return from<type>(static_cast<type>(FromValue));
@@ -162,8 +162,8 @@ struct CheckedInt {
   }
 
   // Convert to integral, asserts if Value cannot be represented as Integral.
-  template <typename Integral, typename std::enable_if_t<
-                                   std::is_integral<Integral>::value, bool> = 0>
+  template <typename Integral,
+            std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
   Integral to() const {
     if (!canTypeFitValue<Integral>(Value))
       assertOutOfBounds();
@@ -173,7 +173,7 @@ struct CheckedInt {
   // Convert to enum, asserts if Value cannot be represented as Enum's
   // underlying type.
   template <typename Enum,
-            typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
+            std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
   Enum to() const {
     using type = std::underlying_type_t<Enum>;
     return Enum(to<type>());

diff  --git a/llvm/include/llvm/ADT/TypeSwitch.h b/llvm/include/llvm/ADT/TypeSwitch.h
index cc69f76594a2..cf58808eb485 100644
--- a/llvm/include/llvm/ADT/TypeSwitch.h
+++ b/llvm/include/llvm/ADT/TypeSwitch.h
@@ -72,8 +72,8 @@ template <typename DerivedT, typename T> class TypeSwitchBase {
   template <typename CastT, typename ValueT>
   static auto castValue(
       ValueT value,
-      typename std::enable_if_t<
-          is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
+      std::enable_if_t<is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
+          nullptr) {
     return value.template dyn_cast<CastT>();
   }
 
@@ -82,8 +82,8 @@ template <typename DerivedT, typename T> class TypeSwitchBase {
   template <typename CastT, typename ValueT>
   static auto castValue(
       ValueT value,
-      typename std::enable_if_t<
-          !is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
+      std::enable_if_t<!is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
+          nullptr) {
     return dyn_cast<CastT>(value);
   }
 

diff  --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 0777005643a7..9cf2e873d718 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -93,7 +93,7 @@ class LinearPolyBase {
   }
 
   template <typename U = ScalarTy>
-  friend typename std::enable_if_t<std::is_signed<U>::value, LeafTy>
+  friend std::enable_if_t<std::is_signed<U>::value, LeafTy>
   operator-(const LeafTy &LHS) {
     LeafTy Copy = LHS;
     return Copy *= -1;


        


More information about the llvm-commits mailing list