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))
35 this->base = cast<const Value *>(owner);
39TypeRange::OwnerT TypeRange::offset_base(OwnerT
object, ptrdiff_t
index) {
40 if (
const auto *value = llvm::dyn_cast_if_present<const Value *>(
object))
41 return {value +
index};
42 if (
auto *operand = llvm::dyn_cast_if_present<OpOperand *>(
object))
43 return {operand +
index};
44 if (
auto *
result = llvm::dyn_cast_if_present<detail::OpResultImpl *>(
object))
45 return {
result->getNextResultAtOffset(index)};
46 return {llvm::dyn_cast_if_present<const Type *>(
object) + index};
50Type TypeRange::dereference_iterator(OwnerT
object, ptrdiff_t
index) {
51 if (
const auto *value = llvm::dyn_cast_if_present<const Value *>(
object))
52 return (value + index)->getType();
53 if (
auto *operand = llvm::dyn_cast_if_present<OpOperand *>(
object))
54 return (operand + index)->get().getType();
55 if (
auto *
result = llvm::dyn_cast_if_present<detail::OpResultImpl *>(
object))
56 return result->getNextResultAtOffset(index)->getType();
57 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 * > OwnerT
The type representing the owner of a ValueRange.
Include the generated interface declarations.