MLIR  20.0.0git
Classes | Public Types | Public Member Functions | List of all members
mlir::ResultRange Class Referencefinal

This class implements the result iterators for the Operation class. More...

#include "mlir/IR/ValueRange.h"

+ Inheritance diagram for mlir::ResultRange:

Classes

class  UseIterator
 This class implements a use iterator for a range of operation results. More...
 

Public Types

using type_iterator = ValueTypeIterator< iterator >
 Returns the types of the values within this range. More...
 
using type_range = ValueTypeRange< ResultRange >
 
using use_iterator = UseIterator
 
using use_range = iterator_range< use_iterator >
 
using user_iterator = ValueUserIterator< use_iterator, OpOperand >
 
using user_range = iterator_range< user_iterator >
 

Public Member Functions

 ResultRange (OpResult result)
 
type_range getTypes () const
 
type_range getType () const
 
use_range getUses () const
 Returns a range of all uses of results within this range, which is useful for iterating over all uses. More...
 
use_iterator use_begin () const
 
use_iterator use_end () const
 
bool use_empty () const
 Returns true if no results in this range have uses. More...
 
template<typename ValuesT >
std::enable_if_t<!std::is_convertible< ValuesT, Operation * >::value > replaceAllUsesWith (ValuesT &&values)
 Replace all uses of results of this range with the provided 'values'. More...
 
void replaceAllUsesWith (Operation *op)
 Replace all uses of results of this range with results of 'op'. More...
 
template<typename ValuesT >
std::enable_if_t<!std::is_convertible< ValuesT, Operation * >::value > replaceUsesWithIf (ValuesT &&values, function_ref< bool(OpOperand &)> shouldReplace)
 Replace uses of results of this range with the provided 'values' if the given callback returns true. More...
 
void replaceUsesWithIf (Operation *op, function_ref< bool(OpOperand &)> shouldReplace)
 Replace uses of results of this range with results of op if the given callback returns true. More...
 
user_range getUsers ()
 Returns a range of all users. More...
 
user_iterator user_begin ()
 
user_iterator user_end ()
 

Detailed Description

This class implements the result iterators for the Operation class.

Definition at line 240 of file ValueRange.h.

Member Typedef Documentation

◆ type_iterator

Returns the types of the values within this range.

Definition at line 252 of file ValueRange.h.

◆ type_range

Definition at line 253 of file ValueRange.h.

◆ use_iterator

Definition at line 262 of file ValueRange.h.

◆ use_range

Definition at line 263 of file ValueRange.h.

◆ user_iterator

Definition at line 317 of file ValueRange.h.

◆ user_range

Definition at line 318 of file ValueRange.h.

Constructor & Destructor Documentation

◆ ResultRange()

ResultRange::ResultRange ( OpResult  result)

Definition at line 580 of file OperationSupport.cpp.

Member Function Documentation

◆ getType()

ResultRange::type_range ResultRange::getType ( ) const

Definition at line 39 of file ValueRange.cpp.

References getTypes().

◆ getTypes()

ResultRange::type_range ResultRange::getTypes ( ) const

◆ getUsers()

ResultRange::user_range ResultRange::getUsers ( )

Returns a range of all users.

Definition at line 593 of file OperationSupport.cpp.

References user_begin(), and user_end().

◆ getUses()

ResultRange::use_range ResultRange::getUses ( ) const

Returns a range of all uses of results within this range, which is useful for iterating over all uses.

Definition at line 584 of file OperationSupport.cpp.

References use_begin(), and use_end().

Referenced by mlir::Operation::getUses().

◆ replaceAllUsesWith() [1/2]

void ResultRange::replaceAllUsesWith ( Operation op)

Replace all uses of results of this range with results of 'op'.

Definition at line 634 of file OperationSupport.cpp.

References mlir::Operation::getResults(), and replaceAllUsesWith().

◆ replaceAllUsesWith() [2/2]

template<typename ValuesT >
std::enable_if_t<!std::is_convertible<ValuesT, Operation *>::value> mlir::ResultRange::replaceAllUsesWith ( ValuesT &&  values)
inline

Replace all uses of results of this range with the provided 'values'.

The size of values must match the size of this range.

Definition at line 281 of file ValueRange.h.

Referenced by replaceAllUsesWith(), and mlir::Operation::replaceAllUsesWith().

◆ replaceUsesWithIf() [1/2]

void ResultRange::replaceUsesWithIf ( Operation op,
function_ref< bool(OpOperand &)>  shouldReplace 
)

Replace uses of results of this range with results of op if the given callback returns true.

Definition at line 638 of file OperationSupport.cpp.

References mlir::Operation::getResults(), and replaceUsesWithIf().

◆ replaceUsesWithIf() [2/2]

template<typename ValuesT >
std::enable_if_t<!std::is_convertible<ValuesT, Operation *>::value> mlir::ResultRange::replaceUsesWithIf ( ValuesT &&  values,
function_ref< bool(OpOperand &)>  shouldReplace 
)
inline

Replace uses of results of this range with the provided 'values' if the given callback returns true.

The size of values must match the size of this range.

Definition at line 298 of file ValueRange.h.

Referenced by replaceUsesWithIf(), and mlir::Operation::replaceUsesWithIf().

◆ use_begin()

ResultRange::use_iterator ResultRange::use_begin ( ) const

Definition at line 587 of file OperationSupport.cpp.

Referenced by getUses(), mlir::Operation::use_begin(), and user_begin().

◆ use_empty()

bool mlir::ResultRange::use_empty ( ) const
inline

Returns true if no results in this range have uses.

Definition at line 272 of file ValueRange.h.

References mlir::Value::use_empty().

Referenced by mlir::Operation::use_empty().

◆ use_end()

ResultRange::use_iterator ResultRange::use_end ( ) const

Definition at line 590 of file OperationSupport.cpp.

Referenced by getUses(), mlir::Operation::use_end(), and user_end().

◆ user_begin()

ResultRange::user_iterator ResultRange::user_begin ( )

Definition at line 596 of file OperationSupport.cpp.

References use_begin().

Referenced by getUsers().

◆ user_end()

ResultRange::user_iterator ResultRange::user_end ( )

Definition at line 599 of file OperationSupport.cpp.

References use_end().

Referenced by getUsers().


The documentation for this class was generated from the following files: