[Mlir-commits] [mlir] de7ff8d - [mlir][NFC] Remove TypeRange's constructors that cause ambiguity
Jeff Niu
llvmlistbot at llvm.org
Mon Jul 25 14:38:09 PDT 2022
Author: lipracer
Date: 2022-07-25T15:38:05-06:00
New Revision: de7ff8d66f61c3e2a5c8e3b199c50f9c2b61dcce
URL: https://github.com/llvm/llvm-project/commit/de7ff8d66f61c3e2a5c8e3b199c50f9c2b61dcce
DIFF: https://github.com/llvm/llvm-project/commit/de7ff8d66f61c3e2a5c8e3b199c50f9c2b61dcce.diff
LOG: [mlir][NFC] Remove TypeRange's constructors that cause ambiguity
ArrayRef<Value> can implicit convert to ValueRange,when we call TypeRange(SmallVector<Value>) is ambiguity.
TypeRange(ValueRange values)
TypeRange(ArrayRef<Value> values)
Reviewed By: rriddle, Mogball
Differential Revision: https://reviews.llvm.org/D129475
Added:
Modified:
mlir/include/mlir/IR/TypeRange.h
mlir/lib/IR/TypeRange.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/TypeRange.h b/mlir/include/mlir/IR/TypeRange.h
index ba797d84a3ae8..8b2959d509b3f 100644
--- a/mlir/include/mlir/IR/TypeRange.h
+++ b/mlir/include/mlir/IR/TypeRange.h
@@ -40,13 +40,10 @@ class TypeRange : public llvm::detail::indexed_accessor_range_base<
explicit TypeRange(OperandRange values);
explicit TypeRange(ResultRange values);
explicit TypeRange(ValueRange values);
- explicit TypeRange(ArrayRef<Value> values);
- explicit TypeRange(ArrayRef<BlockArgument> values)
- : TypeRange(ArrayRef<Value>(values.data(), values.size())) {}
template <typename ValueRangeT>
TypeRange(ValueTypeRange<ValueRangeT> values)
- : TypeRange(ValueRangeT(values.begin().getCurrent(),
- values.end().getCurrent())) {}
+ : 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>>
diff --git a/mlir/lib/IR/TypeRange.cpp b/mlir/lib/IR/TypeRange.cpp
index 003cff8851564..2e2121af024fb 100644
--- a/mlir/lib/IR/TypeRange.cpp
+++ b/mlir/lib/IR/TypeRange.cpp
@@ -23,8 +23,6 @@ TypeRange::TypeRange(OperandRange values)
: TypeRange(values.begin().getBase(), values.size()) {}
TypeRange::TypeRange(ResultRange values)
: TypeRange(values.getBase(), values.size()) {}
-TypeRange::TypeRange(ArrayRef<Value> values)
- : TypeRange(values.data(), values.size()) {}
TypeRange::TypeRange(ValueRange values) : TypeRange(OwnerT(), values.size()) {
if (count == 0)
return;
More information about the Mlir-commits
mailing list