Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions mlir/include/mlir/IR/AffineExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,6 @@ class AffineExpr {

bool operator!() const { return expr == nullptr; }

template <typename U>
[[deprecated("Use llvm::isa<U>() instead")]] constexpr bool isa() const;

template <typename U>
[[deprecated("Use llvm::dyn_cast<U>() instead")]] U dyn_cast() const;

template <typename U>
[[deprecated("Use llvm::dyn_cast_or_null<U>() instead")]] U
dyn_cast_or_null() const;

template <typename U>
[[deprecated("Use llvm::cast<U>() instead")]] U cast() const;

MLIRContext *getContext() const;

/// Return the classification for this type.
Expand Down Expand Up @@ -288,30 +275,6 @@ AffineExpr getAffineExprFromFlatForm(ArrayRef<int64_t> flatExprs,

raw_ostream &operator<<(raw_ostream &os, AffineExpr expr);

template <typename U>
constexpr bool AffineExpr::isa() const {
if constexpr (std::is_same_v<U, AffineBinaryOpExpr>)
return getKind() <= AffineExprKind::LAST_AFFINE_BINARY_OP;
if constexpr (std::is_same_v<U, AffineDimExpr>)
return getKind() == AffineExprKind::DimId;
if constexpr (std::is_same_v<U, AffineSymbolExpr>)
return getKind() == AffineExprKind::SymbolId;
if constexpr (std::is_same_v<U, AffineConstantExpr>)
return getKind() == AffineExprKind::Constant;
}
template <typename U>
U AffineExpr::dyn_cast() const {
return llvm::dyn_cast<U>(*this);
}
template <typename U>
U AffineExpr::dyn_cast_or_null() const {
return llvm::dyn_cast_or_null<U>(*this);
}
template <typename U>
U AffineExpr::cast() const {
return llvm::cast<U>(*this);
}

/// Simplify an affine expression by flattening and some amount of simple
/// analysis. This has complexity linear in the number of nodes in 'expr'.
/// Returns the simplified expression, which is the same as the input expression
Expand Down
43 changes: 0 additions & 43 deletions mlir/include/mlir/IR/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ class Attribute {

bool operator!() const { return impl == nullptr; }

/// Casting utility functions. These are deprecated and will be removed,
/// please prefer using the `llvm` namespace variants instead.
template <typename... Tys>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const;
template <typename... Tys>
[[deprecated("Use mlir::isa_and_nonnull<U>() instead")]]
bool isa_and_nonnull() const;
template <typename U>
[[deprecated("Use mlir::dyn_cast<U>() instead")]]
U dyn_cast() const;
template <typename U>
[[deprecated("Use mlir::dyn_cast_or_null<U>() instead")]]
U dyn_cast_or_null() const;
template <typename U>
[[deprecated("Use mlir::cast<U>() instead")]]
U cast() const;

/// Return a unique identifier for the concrete attribute type. This is used
/// to support dynamic type casting.
TypeID getTypeID() { return impl->getAbstractAttribute().getTypeID(); }
Expand Down Expand Up @@ -170,31 +152,6 @@ inline raw_ostream &operator<<(raw_ostream &os, Attribute attr) {
return os;
}

template <typename... Tys>
bool Attribute::isa() const {
return llvm::isa<Tys...>(*this);
}

template <typename... Tys>
bool Attribute::isa_and_nonnull() const {
return llvm::isa_and_present<Tys...>(*this);
}

template <typename U>
U Attribute::dyn_cast() const {
return llvm::dyn_cast<U>(*this);
}

template <typename U>
U Attribute::dyn_cast_or_null() const {
return llvm::dyn_cast_if_present<U>(*this);
}

template <typename U>
U Attribute::cast() const {
return llvm::cast<U>(*this);
}

inline ::llvm::hash_code hash_value(Attribute arg) {
return DenseMapInfo<const Attribute::ImplType *>::getHashValue(arg.impl);
}
Expand Down
17 changes: 0 additions & 17 deletions mlir/include/mlir/IR/Location.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ class Location {
operator LocationAttr() const { return impl; }
LocationAttr *operator->() const { return const_cast<LocationAttr *>(&impl); }

/// Type casting utilities on the underlying location.
template <typename U>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const {
return llvm::isa<U>(*this);
}
template <typename U>
[[deprecated("Use mlir::dyn_cast<U>() instead")]]
U dyn_cast() const {
return llvm::dyn_cast<U>(*this);
}
template <typename U>
[[deprecated("Use mlir::cast<U>() instead")]]
U cast() const {
return llvm::cast<U>(*this);
}

/// Comparison operators.
bool operator==(Location rhs) const { return impl == rhs.impl; }
bool operator!=(Location rhs) const { return !(*this == rhs); }
Expand Down
41 changes: 0 additions & 41 deletions mlir/include/mlir/IR/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,6 @@ class Type {

bool operator!() const { return impl == nullptr; }

template <typename... Tys>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const;
template <typename... Tys>
[[deprecated("Use mlir::isa_and_nonnull<U>() instead")]]
bool isa_and_nonnull() const;
template <typename U>
[[deprecated("Use mlir::dyn_cast<U>() instead")]]
U dyn_cast() const;
template <typename U>
[[deprecated("Use mlir::dyn_cast_or_null<U>() instead")]]
U dyn_cast_or_null() const;
template <typename U>
[[deprecated("Use mlir::cast<U>() instead")]]
U cast() const;

/// Return a unique identifier for the concrete type. This is used to support
/// dynamic type casting.
TypeID getTypeID() { return impl->getAbstractType().getTypeID(); }
Expand Down Expand Up @@ -319,31 +303,6 @@ inline ::llvm::hash_code hash_value(Type arg) {
return DenseMapInfo<const Type::ImplType *>::getHashValue(arg.impl);
}

template <typename... Tys>
bool Type::isa() const {
return llvm::isa<Tys...>(*this);
}

template <typename... Tys>
bool Type::isa_and_nonnull() const {
return llvm::isa_and_present<Tys...>(*this);
}

template <typename U>
U Type::dyn_cast() const {
return llvm::dyn_cast<U>(*this);
}

template <typename U>
U Type::dyn_cast_or_null() const {
return llvm::dyn_cast_or_null<U>(*this);
}

template <typename U>
U Type::cast() const {
return llvm::cast<U>(*this);
}

} // namespace mlir

namespace llvm {
Expand Down
24 changes: 0 additions & 24 deletions mlir/include/mlir/IR/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,6 @@ class Value {
public:
constexpr Value(detail::ValueImpl *impl = nullptr) : impl(impl) {}

template <typename U>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const {
return llvm::isa<U>(*this);
}

template <typename U>
[[deprecated("Use mlir::dyn_cast<U>() instead")]]
U dyn_cast() const {
return llvm::dyn_cast<U>(*this);
}

template <typename U>
[[deprecated("Use mlir::dyn_cast_or_null<U>() instead")]]
U dyn_cast_or_null() const {
return llvm::dyn_cast_or_null<U>(*this);
}

template <typename U>
[[deprecated("Use mlir::cast<U>() instead")]]
U cast() const {
return llvm::cast<U>(*this);
}

explicit operator bool() const { return impl; }
bool operator==(const Value &other) const { return impl == other.impl; }
bool operator!=(const Value &other) const { return !(*this == other); }
Expand Down
29 changes: 0 additions & 29 deletions mlir/include/mlir/Tools/PDLL/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,6 @@ class Type {
bool operator!=(const Type &other) const { return !(*this == other); }
explicit operator bool() const { return impl; }

/// Provide type casting support.
template <typename U>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const {
assert(impl && "isa<> used on a null type.");
return U::classof(*this);
}
template <typename U, typename V, typename... Others>
[[deprecated("Use mlir::isa<U>() instead")]]
bool isa() const {
return isa<U>() || isa<V, Others...>();
}
template <typename U>
[[deprecated("Use mlir::dyn_cast<U>() instead")]]
U dyn_cast() const {
return isa<U>() ? U(impl) : U(nullptr);
}
template <typename U>
[[deprecated("Use mlir::dyn_cast_or_null<U>() instead")]]
U dyn_cast_or_null() const {
return (impl && isa<U>()) ? U(impl) : U(nullptr);
}
template <typename U>
[[deprecated("Use mlir::cast<U>() instead")]]
U cast() const {
assert(isa<U>());
return U(impl);
}

/// Return the internal storage instance of this type.
Storage *getImpl() const { return impl; }

Expand Down
Loading