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) {}
/// 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
/// 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
/// 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()
/// 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()
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)
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.
/// 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);
/// 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() {
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>
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);
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)) {}
/// 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
/// 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
/// 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>(
/// 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>(
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))) {}
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)
/// 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");
/// 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) {}
/// 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) {
/// 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) {