MLIR  14.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/OperationSupport.h"

Inheritance diagram for mlir::ResultRange:
Inheritance graph
[legend]
Collaboration diagram for mlir::ResultRange:
Collaboration graph
[legend]

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
 
auto 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 * >::valuereplaceAllUsesWith (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...
 
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 951 of file OperationSupport.h.

Member Typedef Documentation

◆ type_iterator

Returns the types of the values within this range.

Definition at line 963 of file OperationSupport.h.

◆ type_range

Definition at line 964 of file OperationSupport.h.

◆ use_iterator

Definition at line 973 of file OperationSupport.h.

◆ use_range

Definition at line 974 of file OperationSupport.h.

◆ user_iterator

Definition at line 1008 of file OperationSupport.h.

◆ user_range

Definition at line 1009 of file OperationSupport.h.

Constructor & Destructor Documentation

◆ ResultRange()

ResultRange::ResultRange ( OpResult  result)

Definition at line 535 of file OperationSupport.cpp.

Member Function Documentation

◆ getType()

auto mlir::ResultRange::getType ( ) const
inline

Definition at line 966 of file OperationSupport.h.

Referenced by getLspDiagnoticFromDiag(), and verify().

◆ getTypes()

type_range mlir::ResultRange::getTypes ( ) const
inline

◆ getUsers()

ResultRange::user_range ResultRange::getUsers ( )

Returns a range of all users.

Definition at line 548 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 539 of file OperationSupport.cpp.

References use_begin(), and use_end().

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

◆ replaceAllUsesWith() [1/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 992 of file OperationSupport.h.

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

◆ replaceAllUsesWith() [2/2]

void ResultRange::replaceAllUsesWith ( Operation op)

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

Definition at line 589 of file OperationSupport.cpp.

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

◆ use_begin()

ResultRange::use_iterator ResultRange::use_begin ( ) const

Definition at line 542 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 983 of file OperationSupport.h.

References mlir::Value::use_empty(), and value.

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

◆ use_end()

ResultRange::use_iterator ResultRange::use_end ( ) const

Definition at line 545 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 551 of file OperationSupport.cpp.

References use_begin().

Referenced by getUsers().

◆ user_end()

ResultRange::user_iterator ResultRange::user_end ( )

Definition at line 554 of file OperationSupport.cpp.

References use_end().

Referenced by getUsers().


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