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
8 changes: 4 additions & 4 deletions mlir/include/mlir/IR/BlockSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class SuccessorRange final
public:
using RangeBaseT::RangeBaseT;
SuccessorRange();
SuccessorRange(Block *block);
SuccessorRange(Operation *term);
SuccessorRange(Block *block LLVM_LIFETIME_BOUND);
Copy link
Contributor

@River707 River707 Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the value of adding it here? The address of these aren't taken, and these aren't really temporaries either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks River for noticing! Removed.

SuccessorRange(Operation *term LLVM_LIFETIME_BOUND);

private:
/// See `llvm::detail::indexed_accessor_range_base` for details.
Expand Down Expand Up @@ -110,9 +110,9 @@ class BlockRange final
BlockRange(SuccessorRange successors);
template <typename Arg, typename = std::enable_if_t<std::is_constructible<
ArrayRef<Block *>, Arg>::value>>
BlockRange(Arg &&arg)
BlockRange(Arg &&arg LLVM_LIFETIME_BOUND)
: BlockRange(ArrayRef<Block *>(std::forward<Arg>(arg))) {}
BlockRange(std::initializer_list<Block *> blocks)
BlockRange(std::initializer_list<Block *> blocks LLVM_LIFETIME_BOUND)
: BlockRange(ArrayRef<Block *>(blocks)) {}

private:
Expand Down
4 changes: 2 additions & 2 deletions mlir/include/mlir/IR/Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ class RegionRange

template <typename Arg, typename = std::enable_if_t<std::is_constructible<
ArrayRef<std::unique_ptr<Region>>, Arg>::value>>
RegionRange(Arg &&arg)
RegionRange(Arg &&arg LLVM_LIFETIME_BOUND)
: RegionRange(ArrayRef<std::unique_ptr<Region>>(std::forward<Arg>(arg))) {
}
template <typename Arg>
RegionRange(
Arg &&arg,
Arg &&arg LLVM_LIFETIME_BOUND,
std::enable_if_t<std::is_constructible<ArrayRef<Region *>, Arg>::value>
* = nullptr)
: RegionRange(ArrayRef<Region *>(std::forward<Arg>(arg))) {}
Expand Down
5 changes: 3 additions & 2 deletions mlir/include/mlir/IR/TypeRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class TypeRange : public llvm::detail::indexed_accessor_range_base<
values.end().getCurrent()))) {}
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(Arg &&arg LLVM_LIFETIME_BOUND)
: TypeRange(ArrayRef<Type>(std::forward<Arg>(arg))) {}
TypeRange(std::initializer_list<Type> types LLVM_LIFETIME_BOUND)
: TypeRange(ArrayRef<Type>(types)) {}

private:
Expand Down
8 changes: 5 additions & 3 deletions mlir/include/mlir/IR/ValueRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,11 @@ class ValueRange final
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))) {}
ValueRange(const Value &value) : ValueRange(&value, /*count=*/1) {}
ValueRange(const std::initializer_list<Value> &values)
ValueRange(Arg &&arg LLVM_LIFETIME_BOUND)
: ValueRange(ArrayRef<Value>(std::forward<Arg>(arg))) {}
ValueRange(const Value &value LLVM_LIFETIME_BOUND)
: ValueRange(&value, /*count=*/1) {}
ValueRange(const std::initializer_list<Value> &values LLVM_LIFETIME_BOUND)
: ValueRange(ArrayRef<Value>(values)) {}
ValueRange(iterator_range<OperandRange::iterator> values)
: ValueRange(OperandRange(values)) {}
Expand Down
Loading