[Mlir-commits] [mlir] de49627 - [mlir] Remove redundaunt typename (NFC)
Kazu Hirata
llvmlistbot at llvm.org
Sat Oct 15 21:07:17 PDT 2022
Author: Kazu Hirata
Date: 2022-10-15T21:07:03-07:00
New Revision: de49627d9d293652590556e77129176de88eb9b3
URL: https://github.com/llvm/llvm-project/commit/de49627d9d293652590556e77129176de88eb9b3
DIFF: https://github.com/llvm/llvm-project/commit/de49627d9d293652590556e77129176de88eb9b3.diff
LOG: [mlir] Remove redundaunt typename (NFC)
Added:
Modified:
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
Removed:
################################################################################
diff --git a/mlir/include/mlir/Analysis/DataFlowFramework.h b/mlir/include/mlir/Analysis/DataFlowFramework.h
index 70281177f4d04..68f3db7d507d4 100644
--- a/mlir/include/mlir/Analysis/DataFlowFramework.h
+++ b/mlir/include/mlir/Analysis/DataFlowFramework.h
@@ -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) {}
diff --git a/mlir/include/mlir/IR/AttributeSupport.h b/mlir/include/mlir/IR/AttributeSupport.h
index 58e37f09e1c6c..691055766ed24 100644
--- a/mlir/include/mlir/IR/AttributeSupport.h
+++ b/mlir/include/mlir/IR/AttributeSupport.h
@@ -182,7 +182,7 @@ class AttributeUniquer {
/// 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 @@ class AttributeUniquer {
/// 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 @@ class AttributeUniquer {
/// 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 @@ class AttributeUniquer {
/// 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()
diff --git a/mlir/include/mlir/IR/BlockSupport.h b/mlir/include/mlir/IR/BlockSupport.h
index dafe75ed2acd3..00401bd2a021b 100644
--- a/mlir/include/mlir/IR/BlockSupport.h
+++ b/mlir/include/mlir/IR/BlockSupport.h
@@ -108,9 +108,8 @@ class BlockRange final
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)
diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
index a9e6e0e12051a..eb60977c8fb62 100644
--- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
+++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.td
@@ -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.
diff --git a/mlir/include/mlir/IR/Matchers.h b/mlir/include/mlir/IR/Matchers.h
index ae8cef4a6e63e..b2edcabf87854 100644
--- a/mlir/include/mlir/IR/Matchers.h
+++ b/mlir/include/mlir/IR/Matchers.h
@@ -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);
diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 6d28752ff2fa3..10bb720eb09fa 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -854,7 +854,7 @@ struct SingleBlock : public TraitBase<ConcreteType, SingleBlock> {
/// 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>
diff --git a/mlir/include/mlir/IR/Region.h b/mlir/include/mlir/IR/Region.h
index d726d93b287e6..25080fab64b26 100644
--- a/mlir/include/mlir/IR/Region.h
+++ b/mlir/include/mlir/IR/Region.h
@@ -340,17 +340,16 @@ class RegionRange
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);
diff --git a/mlir/include/mlir/IR/TypeRange.h b/mlir/include/mlir/IR/TypeRange.h
index 8b2959d509b3f..5bbab1f994ece 100644
--- a/mlir/include/mlir/IR/TypeRange.h
+++ b/mlir/include/mlir/IR/TypeRange.h
@@ -44,9 +44,8 @@ class TypeRange : public llvm::detail::indexed_accessor_range_base<
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)) {}
diff --git a/mlir/include/mlir/IR/TypeSupport.h b/mlir/include/mlir/IR/TypeSupport.h
index b11168712d40b..2bb28fd261eb6 100644
--- a/mlir/include/mlir/IR/TypeSupport.h
+++ b/mlir/include/mlir/IR/TypeSupport.h
@@ -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>(
diff --git a/mlir/include/mlir/IR/ValueRange.h b/mlir/include/mlir/IR/ValueRange.h
index 64b816fae6e38..081c0d2210dea 100644
--- a/mlir/include/mlir/IR/ValueRange.h
+++ b/mlir/include/mlir/IR/ValueRange.h
@@ -356,7 +356,7 @@ class ValueRange final
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))) {}
diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
index eaf1f6ced34b8..89bc251fdf53a 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
@@ -119,7 +119,7 @@ class ShapedTypeComponents {
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)
diff --git a/mlir/include/mlir/Support/InterfaceSupport.h b/mlir/include/mlir/Support/InterfaceSupport.h
index 5a56682f3bc03..73a4387bf1b24 100644
--- a/mlir/include/mlir/Support/InterfaceSupport.h
+++ b/mlir/include/mlir/Support/InterfaceSupport.h
@@ -99,8 +99,8 @@ class Interface : public BaseType {
/// 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");
diff --git a/mlir/include/mlir/TableGen/Class.h b/mlir/include/mlir/TableGen/Class.h
index efcd73ae61de9..896880bc8cdb3 100644
--- a/mlir/include/mlir/TableGen/Class.h
+++ b/mlir/include/mlir/TableGen/Class.h
@@ -573,8 +573,8 @@ class Class {
/// 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) {}
diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp
index 669f53867d740..1acaea7c0b6df 100644
--- a/mlir/lib/IR/SymbolTable.cpp
+++ b/mlir/lib/IR/SymbolTable.cpp
@@ -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) {
More information about the Mlir-commits
mailing list