[mlir] Remove redundaunt typename (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 16 Oct 2022 04:07:03 +0000 (21:07 -0700)
committerKazu Hirata <kazu@google.com>
Sun, 16 Oct 2022 04:07:03 +0000 (21:07 -0700)
14 files changed:
mlir/include/mlir/Analysis/DataFlowFramework.h
mlir/include/mlir/IR/AttributeSupport.h
mlir/include/mlir/IR/BlockSupport.h
mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
mlir/include/mlir/IR/Matchers.h
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/IR/Region.h
mlir/include/mlir/IR/TypeRange.h
mlir/include/mlir/IR/TypeSupport.h
mlir/include/mlir/IR/ValueRange.h
mlir/include/mlir/Interfaces/InferTypeOpInterface.h
mlir/include/mlir/Support/InterfaceSupport.h
mlir/include/mlir/TableGen/Class.h
mlir/lib/IR/SymbolTable.cpp

index 7028117..68f3db7 100644 (file)
@@ -159,7 +159,7 @@ struct ProgramPoint
   ProgramPoint(ParentTy point = nullptr) : ParentTy(point) {}
   /// Allow implicit conversions from operation wrappers.
   /// TODO: For Windows only. Find a better solution.
-  template <typename OpT, typename = typename std::enable_if_t<
+  template <typename OpT, typename = std::enable_if_t<
                               std::is_convertible<OpT, Operation *>::value &&
                               !std::is_same<OpT, Operation *>::value>>
   ProgramPoint(OpT op) : ParentTy(op) {}
index 58e37f0..6910557 100644 (file)
@@ -182,7 +182,7 @@ public:
   /// The use of this method is in general discouraged in favor of
   /// 'get<T, Args>(ctx, args)'.
   template <typename T, typename... Args>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       !std::is_same<typename T::ImplType, AttributeStorage>::value, T>
   getWithTypeID(MLIRContext *ctx, TypeID typeID, Args &&...args) {
 #ifndef NDEBUG
@@ -207,7 +207,7 @@ public:
   /// The use of this method is in general discouraged in favor of
   /// 'get<T, Args>(ctx, args)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       std::is_same<typename T::ImplType, AttributeStorage>::value, T>
   getWithTypeID(MLIRContext *ctx, TypeID typeID) {
 #ifndef NDEBUG
@@ -239,7 +239,7 @@ public:
   /// The use of this method is in general discouraged in favor of
   /// 'registerAttribute<T>(ctx)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       !std::is_same<typename T::ImplType, AttributeStorage>::value>
   registerAttribute(MLIRContext *ctx, TypeID typeID) {
     ctx->getAttributeUniquer()
@@ -249,7 +249,7 @@ public:
   /// The use of this method is in general discouraged in favor of
   /// 'registerAttribute<T>(ctx)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       std::is_same<typename T::ImplType, AttributeStorage>::value>
   registerAttribute(MLIRContext *ctx, TypeID typeID) {
     ctx->getAttributeUniquer()
index dafe75e..00401bd 100644 (file)
@@ -108,9 +108,8 @@ public:
   using RangeBaseT::RangeBaseT;
   BlockRange(ArrayRef<Block *> blocks = llvm::None);
   BlockRange(SuccessorRange successors);
-  template <typename Arg,
-            typename = typename std::enable_if_t<
-                std::is_constructible<ArrayRef<Block *>, Arg>::value>>
+  template <typename Arg, typename = std::enable_if_t<std::is_constructible<
+                              ArrayRef<Block *>, Arg>::value>>
   BlockRange(Arg &&arg)
       : BlockRange(ArrayRef<Block *>(std::forward<Arg>(arg))) {}
   BlockRange(std::initializer_list<Block *> blocks)
index a9e6e0e..eb60977 100644 (file)
@@ -338,13 +338,13 @@ def ElementsAttrInterface : AttrInterface<"ElementsAttr"> {
 
     template <typename T>
     using DerivedAttrValueCheckT =
-        typename std::enable_if_t<std::is_base_of<Attribute, T>::value &&
-                                  !std::is_same<Attribute, T>::value>;
+        std::enable_if_t<std::is_base_of<Attribute, T>::value &&
+                         !std::is_same<Attribute, T>::value>;
     template <typename T, typename ResultT>
     using DefaultValueCheckT =
-        typename std::enable_if_t<std::is_same<Attribute, T>::value ||
-                                  !std::is_base_of<Attribute, T>::value,
-                                  ResultT>;
+        std::enable_if_t<std::is_same<Attribute, T>::value ||
+                             !std::is_base_of<Attribute, T>::value,
+                         ResultT>;
 
     /// Return the splat value for this attribute. This asserts that the
     /// attribute corresponds to a splat.
index ae8cef4..b2edcab 100644 (file)
@@ -178,20 +178,18 @@ using has_operation_or_value_matcher_t =
 
 /// Statically switch to a Value matcher.
 template <typename MatcherClass>
-typename std::enable_if_t<
-    llvm::is_detected<detail::has_operation_or_value_matcher_t, MatcherClass,
-                      Value>::value,
-    bool>
+std::enable_if_t<llvm::is_detected<detail::has_operation_or_value_matcher_t,
+                                   MatcherClass, Value>::value,
+                 bool>
 matchOperandOrValueAtIndex(Operation *op, unsigned idx, MatcherClass &matcher) {
   return matcher.match(op->getOperand(idx));
 }
 
 /// Statically switch to an Operation matcher.
 template <typename MatcherClass>
-typename std::enable_if_t<
-    llvm::is_detected<detail::has_operation_or_value_matcher_t, MatcherClass,
-                      Operation *>::value,
-    bool>
+std::enable_if_t<llvm::is_detected<detail::has_operation_or_value_matcher_t,
+                                   MatcherClass, Operation *>::value,
+                 bool>
 matchOperandOrValueAtIndex(Operation *op, unsigned idx, MatcherClass &matcher) {
   if (auto *defOp = op->getOperand(idx).getDefiningOp())
     return matcher.match(defOp);
index 6d28752..10bb720 100644 (file)
@@ -854,7 +854,7 @@ public:
   /// can use SFINAE to disable the methods for non-single region operations.
   template <typename OpT, typename T = void>
   using enable_if_single_region =
-      typename std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>;
+      std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>;
 
   template <typename OpT = ConcreteType>
   enable_if_single_region<OpT, Block::iterator> begin() {
@@ -957,7 +957,7 @@ struct SingleBlockImplicitTerminator {
 
     template <typename OpT, typename T = void>
     using enable_if_single_region =
-        typename std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>;
+        std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>;
 
     /// Insert the operation into the back of the body, before the terminator.
     template <typename OpT = ConcreteType>
index d726d93..25080fa 100644 (file)
@@ -340,17 +340,16 @@ public:
 
   RegionRange(MutableArrayRef<Region> regions = llvm::None);
 
-  template <typename Arg,
-            typename = typename std::enable_if_t<std::is_constructible<
-                ArrayRef<std::unique_ptr<Region>>, Arg>::value>>
+  template <typename Arg, typename = std::enable_if_t<std::is_constructible<
+                              ArrayRef<std::unique_ptr<Region>>, Arg>::value>>
   RegionRange(Arg &&arg)
       : RegionRange(ArrayRef<std::unique_ptr<Region>>(std::forward<Arg>(arg))) {
   }
   template <typename Arg>
   RegionRange(
       Arg &&arg,
-      typename std::enable_if_t<
-          std::is_constructible<ArrayRef<Region *>, Arg>::value> * = nullptr)
+      std::enable_if_t<std::is_constructible<ArrayRef<Region *>, Arg>::value>
+          * = nullptr)
       : RegionRange(ArrayRef<Region *>(std::forward<Arg>(arg))) {}
   RegionRange(ArrayRef<std::unique_ptr<Region>> regions);
   RegionRange(ArrayRef<Region *> regions);
index 8b2959d..5bbab1f 100644 (file)
@@ -44,9 +44,8 @@ public:
   TypeRange(ValueTypeRange<ValueRangeT> values)
       : TypeRange(ValueRange(ValueRangeT(values.begin().getCurrent(),
                                          values.end().getCurrent()))) {}
-  template <typename Arg,
-            typename = typename std::enable_if_t<
-                std::is_constructible<ArrayRef<Type>, Arg>::value>>
+  template <typename Arg, typename = std::enable_if_t<std::is_constructible<
+                              ArrayRef<Type>, Arg>::value>>
   TypeRange(Arg &&arg) : TypeRange(ArrayRef<Type>(std::forward<Arg>(arg))) {}
   TypeRange(std::initializer_list<Type> types)
       : TypeRange(ArrayRef<Type>(types)) {}
index b111687..2bb28fd 100644 (file)
@@ -175,7 +175,7 @@ struct TypeUniquer {
   /// The use of this method is in general discouraged in favor of
   /// 'get<T, Args>(ctx, args)'.
   template <typename T, typename... Args>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       !std::is_same<typename T::ImplType, TypeStorage>::value, T>
   getWithTypeID(MLIRContext *ctx, TypeID typeID, Args &&...args) {
 #ifndef NDEBUG
@@ -196,7 +196,7 @@ struct TypeUniquer {
   /// The use of this method is in general discouraged in favor of
   /// 'get<T, Args>(ctx, args)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       std::is_same<typename T::ImplType, TypeStorage>::value, T>
   getWithTypeID(MLIRContext *ctx, TypeID typeID) {
 #ifndef NDEBUG
@@ -230,7 +230,7 @@ struct TypeUniquer {
   /// The use of this method is in general discouraged in favor of
   /// 'registerType<T>(ctx)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       !std::is_same<typename T::ImplType, TypeStorage>::value>
   registerType(MLIRContext *ctx, TypeID typeID) {
     ctx->getTypeUniquer().registerParametricStorageType<typename T::ImplType>(
@@ -240,7 +240,7 @@ struct TypeUniquer {
   /// The use of this method is in general discouraged in favor of
   /// 'registerType<T>(ctx)'.
   template <typename T>
-  static typename std::enable_if_t<
+  static std::enable_if_t<
       std::is_same<typename T::ImplType, TypeStorage>::value>
   registerType(MLIRContext *ctx, TypeID typeID) {
     ctx->getTypeUniquer().registerSingletonStorageType<TypeStorage>(
index 64b816f..081c0d2 100644 (file)
@@ -356,7 +356,7 @@ public:
   using RangeBaseT::RangeBaseT;
 
   template <typename Arg,
-            typename = typename std::enable_if_t<
+            typename = std::enable_if_t<
                 std::is_constructible<ArrayRef<Value>, Arg>::value &&
                 !std::is_convertible<Arg, Value>::value>>
   ValueRange(Arg &&arg) : ValueRange(ArrayRef<Value>(std::forward<Arg>(arg))) {}
index eaf1f6c..89bc251 100644 (file)
@@ -119,7 +119,7 @@ public:
     if (ranked)
       adaptor.getDims(*this);
   }
-  template <typename Arg, typename = typename std::enable_if_t<
+  template <typename Arg, typename = std::enable_if_t<
                               std::is_constructible<ShapeStorageT, Arg>::value>>
   ShapedTypeComponents(Arg &&arg, Type elementType = nullptr,
                        Attribute attr = nullptr)
index 5a56682..73a4387 100644 (file)
@@ -99,8 +99,8 @@ public:
 
   /// Construct an interface instance from a type that implements this
   /// interface's trait.
-  template <typename T, typename std::enable_if_t<
-                            std::is_base_of<Trait<T>, T>::value> * = nullptr>
+  template <typename T,
+            std::enable_if_t<std::is_base_of<Trait<T>, T>::value> * = nullptr>
   Interface(T t)
       : BaseType(t), impl(t ? ConcreteType::getInterfaceFor(t) : nullptr) {
     assert((!t || impl) && "expected value to provide interface instance");
index efcd73a..896880b 100644 (file)
@@ -573,8 +573,8 @@ public:
   /// Create a class with a name, and whether it should be declared as a `class`
   /// or `struct`. Also, prevent this from being mistaken as a move constructor
   /// candidate.
-  template <typename NameT, typename = typename std::enable_if_t<
-                                !std::is_same<NameT, Class>::value>>
+  template <typename NameT,
+            typename = std::enable_if_t<!std::is_same<NameT, Class>::value>>
   Class(NameT &&name, bool isStruct = false)
       : className(stringify(std::forward<NameT>(name))), isStruct(isStruct) {}
 
index 669f538..1acaea7 100644 (file)
@@ -596,7 +596,7 @@ struct SymbolScope {
   /// This variant is used when the callback type matches that expected by
   /// 'walkSymbolUses'.
   template <typename CallbackT,
-            typename std::enable_if_t<!std::is_same<
+            std::enable_if_t<!std::is_same<
                 typename llvm::function_traits<CallbackT>::result_t,
                 void>::value> * = nullptr>
   Optional<WalkResult> walk(CallbackT cback) {
@@ -607,7 +607,7 @@ struct SymbolScope {
   /// This variant is used when the callback type matches a stripped down type:
   /// void(SymbolTable::SymbolUse use)
   template <typename CallbackT,
-            typename std::enable_if_t<std::is_same<
+            std::enable_if_t<std::is_same<
                 typename llvm::function_traits<CallbackT>::result_t,
                 void>::value> * = nullptr>
   Optional<WalkResult> walk(CallbackT cback) {