[Mlir-commits] [mlir] 36117cc - [llvm] Declare llvm::makeArrayRef as obsolete
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jan 10 09:20:24 PST 2023
Author: serge-sans-paille
Date: 2023-01-10T18:19:58+01:00
New Revision: 36117cc46388d677359f1180bd536f80d0c5fe97
URL: https://github.com/llvm/llvm-project/commit/36117cc46388d677359f1180bd536f80d0c5fe97
DIFF: https://github.com/llvm/llvm-project/commit/36117cc46388d677359f1180bd536f80d0c5fe97.diff
LOG: [llvm] Declare llvm::makeArrayRef as obsolete
Also cleans up a few remaining references.
This is the final commit for the series started by
https://reviews.llvm.org/D140896
Added:
Modified:
llvm/include/llvm/ADT/ArrayRef.h
mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h
index 793fffa428641..f2f761a908f88 100644
--- a/llvm/include/llvm/ADT/ArrayRef.h
+++ b/llvm/include/llvm/ADT/ArrayRef.h
@@ -491,10 +491,10 @@ namespace llvm {
template <typename T, std::size_t N>
ArrayRef(const std::array<T, N> &Vec) -> ArrayRef<T>;
- /// Deduction guide to construct an ArrayRef from an ArrayRef (no-op) (const)
+ /// Deduction guide to construct an ArrayRef from an ArrayRef (const)
template <typename T> ArrayRef(const ArrayRef<T> &Vec) -> ArrayRef<T>;
- /// Deduction guide to construct an ArrayRef from an ArrayRef (no-op)
+ /// Deduction guide to construct an ArrayRef from an ArrayRef
template <typename T> ArrayRef(ArrayRef<T> &Vec) -> ArrayRef<T>;
/// Deduction guide to construct an ArrayRef from a C array.
@@ -505,59 +505,71 @@ namespace llvm {
/// @name ArrayRef Convenience constructors
/// @{
/// Construct an ArrayRef from a single element.
- template<typename T>
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const T &OneElt) {
return OneElt;
}
/// Construct an ArrayRef from a pointer and length.
- template<typename T>
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const T *data, size_t length) {
return ArrayRef<T>(data, length);
}
/// Construct an ArrayRef from a range.
- template<typename T>
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const T *begin, const T *end) {
return ArrayRef<T>(begin, end);
}
/// Construct an ArrayRef from a SmallVector.
template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const SmallVectorImpl<T> &Vec) {
return Vec;
}
/// Construct an ArrayRef from a SmallVector.
template <typename T, unsigned N>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const SmallVector<T, N> &Vec) {
return Vec;
}
/// Construct an ArrayRef from a std::vector.
- template<typename T>
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const std::vector<T> &Vec) {
return Vec;
}
/// Construct an ArrayRef from a std::array.
template <typename T, std::size_t N>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const std::array<T, N> &Arr) {
return Arr;
}
/// Construct an ArrayRef from an ArrayRef (no-op) (const)
- template <typename T> ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
+ ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
return Vec;
}
/// Construct an ArrayRef from an ArrayRef (no-op)
- template <typename T> ArrayRef<T> &makeArrayRef(ArrayRef<T> &Vec) {
+ template <typename T>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
+ ArrayRef<T> &makeArrayRef(ArrayRef<T> &Vec) {
return Vec;
}
/// Construct an ArrayRef from a C array.
- template<typename T, size_t N>
+ template <typename T, size_t N>
+ LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
return ArrayRef<T>(Arr);
}
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
index 1ed71db64b8a8..0d4bff8aa6e09 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVWebGPUTransforms.cpp
@@ -130,7 +130,7 @@ Value lowerExtendedMultiplication(Operation *mulOp, PatternRewriter &rewriter,
Value high = combineDigits(resultDigits[2], resultDigits[3]);
return rewriter.create<CompositeConstructOp>(
- loc, mulOp->getResultTypes().front(), llvm::makeArrayRef({low, high}));
+ loc, mulOp->getResultTypes().front(), llvm::ArrayRef({low, high}));
}
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
index b8a4ee7d66d74..929a534f8d202 100644
--- a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
+++ b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
@@ -394,7 +394,7 @@ void transform::TransformResults::setParams(
assert(paramSegments[position].data() == nullptr && "params already set");
size_t start = this->params.size();
llvm::append_range(this->params, params);
- paramSegments[position] = makeArrayRef(this->params).drop_front(start);
+ paramSegments[position] = ArrayRef(this->params).drop_front(start);
}
ArrayRef<Operation *>
More information about the Mlir-commits
mailing list