Jlm
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
jlm::rvsdg::Output Class Reference

#include <node.hpp>

Inheritance diagram for jlm::rvsdg::Output:
Inheritance graph
[legend]
Collaboration diagram for jlm::rvsdg::Output:
Collaboration graph
[legend]

Classes

class  ConstIterator
 
class  Iterator
 

Public Types

using UsersList = Input::UsersList
 
using UsersRange = jlm::util::IteratorRange< UsersList::Iterator >
 
using UsersConstRange = jlm::util::IteratorRange< UsersList::ConstIterator >
 

Public Member Functions

virtual ~Output () noexcept
 
 Output (const Output &)=delete
 
 Output (Output &&)=delete
 
Outputoperator= (const Output &)=delete
 
Outputoperator= (Output &&)=delete
 
size_t index () const noexcept
 
size_t nusers () const noexcept
 
bool IsDead () const noexcept
 
void divert_users (jlm::rvsdg::Output *new_origin)
 
template<typename F >
size_t divertUsersWhere (Output &newOrigin, const F &match)
 
rvsdg::InputSingleUser () noexcept
 
UsersRange Users ()
 
UsersConstRange Users () const
 
const std::shared_ptr< const rvsdg::Type > & Type () const noexcept
 
rvsdg::Regionregion () const noexcept
 
virtual std::string debug_string () const
 
std::variant< Node *, Region * > GetOwner () const noexcept
 

Protected Member Functions

 Output (Node &owner, std::shared_ptr< const rvsdg::Type > type)
 
 Output (Region *owner, std::shared_ptr< const rvsdg::Type > type)
 

Private Member Functions

void remove_user (jlm::rvsdg::Input *user)
 
void add_user (jlm::rvsdg::Input *user)
 

Private Attributes

friend Input
 
size_t index_
 
std::variant< Node *, Region * > Owner_
 
std::shared_ptr< const rvsdg::TypeType_
 
UsersList Users_
 
std::size_t NumUsers_ = 0
 

Friends

class Node
 
class Region
 

Detailed Description

Definition at line 245 of file node.hpp.

Member Typedef Documentation

◆ UsersConstRange

Definition at line 259 of file node.hpp.

◆ UsersList

Definition at line 257 of file node.hpp.

◆ UsersRange

Definition at line 258 of file node.hpp.

Constructor & Destructor Documentation

◆ Output() [1/4]

jlm::rvsdg::Output::Output ( Node owner,
std::shared_ptr< const rvsdg::Type type 
)
protected

Definition at line 138 of file node.cpp.

◆ Output() [2/4]

jlm::rvsdg::Output::Output ( rvsdg::Region owner,
std::shared_ptr< const rvsdg::Type type 
)
protected

Definition at line 144 of file node.cpp.

◆ ~Output()

jlm::rvsdg::Output::~Output ( )
virtualnoexcept

Definition at line 133 of file node.cpp.

◆ Output() [3/4]

jlm::rvsdg::Output::Output ( const Output )
delete

◆ Output() [4/4]

jlm::rvsdg::Output::Output ( Output &&  )
delete

Member Function Documentation

◆ add_user()

void jlm::rvsdg::Output::add_user ( jlm::rvsdg::Input user)
private

Definition at line 193 of file node.cpp.

◆ debug_string()

std::string jlm::rvsdg::Output::debug_string ( ) const
virtual

Reimplemented in jlm::rvsdg::RegionArgument, and jlm::rvsdg::GraphImport.

Definition at line 168 of file node.cpp.

◆ divert_users()

void jlm::rvsdg::Output::divert_users ( jlm::rvsdg::Output new_origin)
inline

Definition at line 301 of file node.hpp.

◆ divertUsersWhere()

template<typename F >
size_t jlm::rvsdg::Output::divertUsersWhere ( Output newOrigin,
const F &  match 
)
inline

Divert all users of the output that satisfy the predicate match.

Template Parameters
FA functor with the signature (const rvsdg::Input &) -> bool
Parameters
newOriginThe new origin of each user that satisfies match.
matchAn instance of F, to be invoked on each user
Returns
The number of diverted users.

Definition at line 321 of file node.hpp.

◆ GetOwner()

std::variant<Node *, Region *> jlm::rvsdg::Output::GetOwner ( ) const
inlinenoexcept

Definition at line 378 of file node.hpp.

◆ index()

size_t jlm::rvsdg::Output::index ( ) const
inlinenoexcept

Definition at line 274 of file node.hpp.

◆ IsDead()

bool jlm::rvsdg::Output::IsDead ( ) const
inlinenoexcept

Determines whether the output is dead.

An output is considered dead when it has no users.

Returns
True, if the output is dead, otherwise false.
See also
nusers()

Definition at line 295 of file node.hpp.

◆ nusers()

size_t jlm::rvsdg::Output::nusers ( ) const
inlinenoexcept

Definition at line 280 of file node.hpp.

◆ operator=() [1/2]

Output& jlm::rvsdg::Output::operator= ( const Output )
delete

◆ operator=() [2/2]

Output& jlm::rvsdg::Output::operator= ( Output &&  )
delete

◆ region()

rvsdg::Region * jlm::rvsdg::Output::region ( ) const
noexcept

Definition at line 151 of file node.cpp.

◆ remove_user()

void jlm::rvsdg::Output::remove_user ( jlm::rvsdg::Input user)
private

Definition at line 174 of file node.cpp.

◆ SingleUser()

rvsdg::Input& jlm::rvsdg::Output::SingleUser ( )
inlinenoexcept
Returns
The first and only user of the output.
Precondition
The output has only a single user.

Definition at line 347 of file node.hpp.

◆ Type()

const std::shared_ptr<const rvsdg::Type>& jlm::rvsdg::Output::Type ( ) const
inlinenoexcept

Definition at line 366 of file node.hpp.

◆ Users() [1/2]

UsersRange jlm::rvsdg::Output::Users ( )
inline

Definition at line 354 of file node.hpp.

◆ Users() [2/2]

UsersConstRange jlm::rvsdg::Output::Users ( ) const
inline

Definition at line 360 of file node.hpp.

Friends And Related Function Documentation

◆ Node

friend class Node
friend

Definition at line 248 of file node.hpp.

◆ Region

friend class Region
friend

Definition at line 249 of file node.hpp.

Member Data Documentation

◆ index_

size_t jlm::rvsdg::Output::index_
private

Definition at line 522 of file node.hpp.

◆ Input

friend jlm::rvsdg::Output::Input
private

Definition at line 247 of file node.hpp.

◆ NumUsers_

std::size_t jlm::rvsdg::Output::NumUsers_ = 0
private

Definition at line 526 of file node.hpp.

◆ Owner_

std::variant<Node *, Region *> jlm::rvsdg::Output::Owner_
private

Definition at line 523 of file node.hpp.

◆ Type_

std::shared_ptr<const rvsdg::Type> jlm::rvsdg::Output::Type_
private

Definition at line 524 of file node.hpp.

◆ Users_

UsersList jlm::rvsdg::Output::Users_
private

Definition at line 525 of file node.hpp.


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