19 assert(llvm::all_of(types, [](
Type t) {
return t; }) &&
20 "attempting to construct a TypeRange with null types");
30 if (
auto *
result = llvm::dyn_cast_if_present<detail::OpResultImpl *>(owner))
32 else if (
auto *operand = llvm::dyn_cast_if_present<OpOperand *>(owner))
34 else if (
auto *repeated =
36 this->base = repeated;
38 this->base = cast<const Value *>(owner);
42TypeRange::OwnerT TypeRange::offset_base(OwnerT
object, ptrdiff_t
index) {
43 if (
const auto *value = llvm::dyn_cast_if_present<const Value *>(
object))
44 return {value +
index};
45 if (
auto *operand = llvm::dyn_cast_if_present<OpOperand *>(
object))
46 return {operand +
index};
47 if (
auto *
result = llvm::dyn_cast_if_present<detail::OpResultImpl *>(
object))
48 return {
result->getNextResultAtOffset(index)};
50 if (llvm::isa<
const Repeated<Type> *,
const Repeated<Value> *>(
object))
52 return {llvm::dyn_cast_if_present<const Type *>(
object) + index};
56Type TypeRange::dereference_iterator(OwnerT
object, ptrdiff_t
index) {
57 if (
const auto *value = llvm::dyn_cast_if_present<const Value *>(
object))
58 return (value + index)->getType();
59 if (
auto *operand = llvm::dyn_cast_if_present<OpOperand *>(
object))
60 return (operand + index)->get().getType();
61 if (
auto *
result = llvm::dyn_cast_if_present<detail::OpResultImpl *>(
object))
62 return result->getNextResultAtOffset(index)->getType();
64 llvm::dyn_cast_if_present<
const Repeated<Type> *>(
object))
65 return repeated->value();
67 llvm::dyn_cast_if_present<
const Repeated<Value> *>(
object))
68 return repeated->value().getType();
69 return llvm::dyn_cast_if_present<const Type *>(
object)[index];
static Value getBase(Value v)
Looks through known "view-like" ops to find the base memref.
This class implements the operand iterators for the Operation class.
This class implements the result iterators for the Operation class.
TypeRange(ArrayRef< Type > types={})
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class provides an abstraction over the different types of ranges over Values.
PointerUnion< const Value *, OpOperand *, detail::OpResultImpl *, const Repeated< Value > * > OwnerT
The type representing the owner of a ValueRange.
Include the generated interface declarations.