Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/IR/TypeRange.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | private: | ||||
friend RangeBaseT; | friend RangeBaseT; | ||||
}; | }; | ||||
/// Make TypeRange hashable. | /// Make TypeRange hashable. | ||||
inline ::llvm::hash_code hash_value(TypeRange arg) { | inline ::llvm::hash_code hash_value(TypeRange arg) { | ||||
return ::llvm::hash_combine_range(arg.begin(), arg.end()); | return ::llvm::hash_combine_range(arg.begin(), arg.end()); | ||||
} | } | ||||
/// Emit a type range to the given output stream. | |||||
inline raw_ostream &operator<<(raw_ostream &os, const TypeRange &types) { | |||||
llvm::interleaveComma(types, os); | |||||
return os; | |||||
} | |||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// ValueTypeRange | // ValueTypeRange | ||||
/// This class implements iteration on the types of a given range of values. | /// This class implements iteration on the types of a given range of values. | ||||
template <typename ValueIteratorT> | template <typename ValueIteratorT> | ||||
class ValueTypeIterator final | class ValueTypeIterator final | ||||
: public llvm::mapped_iterator<ValueIteratorT, Type (*)(Value)> { | : public llvm::mapped_iterator<ValueIteratorT, Type (*)(Value)> { | ||||
static Type unwrap(Value value) { return value.getType(); } | static Type unwrap(Value value) { return value.getType(); } | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |