MLIR  20.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
mlir::CallGraphNode Class Reference

This class represents a single callable in the callgraph. More...

#include "mlir/Analysis/CallGraph.h"

Classes

class  Edge
 This class represents a directed edge between two nodes in the callgraph. More...
 

Public Types

using iterator = SmallVectorImpl< Edge >::const_iterator
 Iterator over the outgoing edges of this node. More...
 

Public Member Functions

bool isExternal () const
 Returns true if this node is an external node. More...
 
RegiongetCallableRegion () const
 Returns the callable region this node represents. More...
 
void addAbstractEdge (CallGraphNode *node)
 Adds an abstract reference edge to the given node. More...
 
void addCallEdge (CallGraphNode *node)
 Add an outgoing call edge from this node. More...
 
void addChildEdge (CallGraphNode *child)
 Adds a reference edge to the given child node. More...
 
iterator begin () const
 
iterator end () const
 
bool hasChildren () const
 Returns true if this node has any child edges. More...
 

Friends

class CallGraph
 

Detailed Description

This class represents a single callable in the callgraph.

Aside from the external node, each node represents a callable node in the graph and contains a valid corresponding Region. The external node is a virtual node used to represent external edges into, and out of, the callgraph.

Definition at line 40 of file CallGraph.h.

Member Typedef Documentation

◆ iterator

Iterator over the outgoing edges of this node.

Definition at line 110 of file CallGraph.h.

Member Function Documentation

◆ addAbstractEdge()

void CallGraphNode::addAbstractEdge ( CallGraphNode node)

Adds an abstract reference edge to the given node.

Adds an reference edge to the given node.

An abstract edge does not come from any observable operations, so this is only valid on the external node.

This is only valid on the external node.

Definition at line 43 of file CallGraph.cpp.

References isExternal().

Referenced by mlir::CallGraph::getOrAddNode().

◆ addCallEdge()

void CallGraphNode::addCallEdge ( CallGraphNode node)

Add an outgoing call edge from this node.

Definition at line 49 of file CallGraph.cpp.

Referenced by computeCallGraph().

◆ addChildEdge()

void CallGraphNode::addChildEdge ( CallGraphNode child)

Adds a reference edge to the given child node.

Definition at line 54 of file CallGraph.cpp.

Referenced by mlir::CallGraph::getOrAddNode().

◆ begin()

iterator mlir::CallGraphNode::begin ( ) const
inline

◆ end()

iterator mlir::CallGraphNode::end ( ) const
inline

◆ getCallableRegion()

Region * CallGraphNode::getCallableRegion ( ) const

Returns the callable region this node represents.

Return the callable region this node represents.

This can only be called on non-external nodes.

Definition at line 36 of file CallGraph.cpp.

References isExternal().

Referenced by mlir::CallGraph::eraseNode(), isProfitableToInline(), and mlir::CallGraph::print().

◆ hasChildren()

bool CallGraphNode::hasChildren ( ) const

Returns true if this node has any child edges.

Definition at line 59 of file CallGraph.cpp.

References mlir::CallGraphNode::Edge::isChild().

Referenced by mlir::CallGraph::eraseNode().

◆ isExternal()

bool CallGraphNode::isExternal ( ) const

Returns true if this node is an external node.

Returns true if this node refers to the indirect/external node.

Definition at line 32 of file CallGraph.cpp.

Referenced by addAbstractEdge(), collectCallOps(), and getCallableRegion().

Friends And Related Function Documentation

◆ CallGraph

friend class CallGraph
friend

Definition at line 147 of file CallGraph.h.


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