MLIR  19.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 237 of file ValueRange.h.

Member Typedef Documentation

◆ type_iterator

Returns the types of the values within this range.

Definition at line 249 of file ValueRange.h.

◆ type_range

Definition at line 250 of file ValueRange.h.

◆ use_iterator

Definition at line 259 of file ValueRange.h.

◆ use_range

Definition at line 260 of file ValueRange.h.

◆ user_iterator

Definition at line 314 of file ValueRange.h.

◆ user_range

Definition at line 315 of file ValueRange.h.

Constructor & Destructor Documentation

◆ ResultRange()

ResultRange::ResultRange ( OpResult  result)

Definition at line 575 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

Definition at line 35 of file ValueRange.cpp.

Referenced by mlir::Operation::getResultTypes(), and getType().

◆ getUsers()

ResultRange::user_range ResultRange::getUsers ( )

Returns a range of all users.

Definition at line 588 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 579 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 629 of file OperationSupport.cpp.

◆ 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 278 of file ValueRange.h.

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

◆ 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 633 of file OperationSupport.cpp.

◆ 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 295 of file ValueRange.h.

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

◆ use_begin()

ResultRange::use_iterator ResultRange::use_begin ( ) const

Definition at line 582 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 269 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 585 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 591 of file OperationSupport.cpp.

References use_begin().

Referenced by getUsers().

◆ user_end()

ResultRange::user_iterator ResultRange::user_end ( )

Definition at line 594 of file OperationSupport.cpp.

References use_end().

Referenced by getUsers().


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