LLVM  6.0.0svn
Public Member Functions | Friends | List of all members
llvm::LazyCallGraph::Node Class Reference

A node in the call graph. More...

#include "llvm/Analysis/LazyCallGraph.h"

Public Member Functions

LazyCallGraphgetGraph () const
 
FunctiongetFunction () const
 
StringRef getName () const
 
bool operator== (const Node &N) const
 Equality is defined as address equality. More...
 
bool operator!= (const Node &N) const
 
bool isPopulated () const
 Tests whether the node has been populated with edges. More...
 
bool isDead () const
 Tests whether this is actually a dead node and no longer valid. More...
 
EdgeSequenceoperator* () const
 
EdgeSequenceoperator-> () const
 
EdgeSequencepopulate ()
 Populate the edges of this node if necessary. More...
 

Friends

class LazyCallGraph
 
class LazyCallGraph::RefSCC
 
raw_ostreamoperator<< (raw_ostream &OS, const Node &N)
 Print the name of this node's function. More...
 

Detailed Description

A node in the call graph.

This represents a single node. It's primary roles are to cache the list of callees, de-duplicate and provide fast testing of whether a function is a callee, and facilitate iteration of child nodes in the graph.

The node works much like an optional in order to lazily populate the edges of each node. Until populated, there are no edges. Once populated, you can access the edges by dereferencing the node or using the -> operator as if the node was an Optional<EdgeSequence>.

Definition at line 327 of file LazyCallGraph.h.

Member Function Documentation

◆ getFunction()

Function& llvm::LazyCallGraph::Node::getFunction ( ) const
inline

◆ getGraph()

LazyCallGraph& llvm::LazyCallGraph::Node::getGraph ( ) const
inline

Definition at line 332 of file LazyCallGraph.h.

References G.

◆ getName()

StringRef llvm::LazyCallGraph::Node::getName ( ) const
inline

Definition at line 336 of file LazyCallGraph.h.

References F().

Referenced by addEdge().

◆ isDead()

bool llvm::LazyCallGraph::Node::isDead ( ) const
inline

Tests whether this is actually a dead node and no longer valid.

Users rarely interact with nodes in this state and other methods are invalid. This is used to model a node in an edge list where the function has been completely removed.

Definition at line 350 of file LazyCallGraph.h.

References assert(), F(), and G.

◆ isPopulated()

bool llvm::LazyCallGraph::Node::isPopulated ( ) const
inline

Tests whether the node has been populated with edges.

Definition at line 343 of file LazyCallGraph.h.

◆ operator!=()

bool llvm::LazyCallGraph::Node::operator!= ( const Node N) const
inline

Definition at line 340 of file LazyCallGraph.h.

References llvm::operator==().

◆ operator*()

EdgeSequence& llvm::LazyCallGraph::Node::operator* ( ) const
inline

Definition at line 358 of file LazyCallGraph.h.

◆ operator->()

EdgeSequence* llvm::LazyCallGraph::Node::operator-> ( ) const
inline

Definition at line 362 of file LazyCallGraph.h.

◆ operator==()

bool llvm::LazyCallGraph::Node::operator== ( const Node N) const
inline

Equality is defined as address equality.

Definition at line 339 of file LazyCallGraph.h.

References N.

◆ populate()

EdgeSequence& llvm::LazyCallGraph::Node::populate ( )
inline

Populate the edges of this node if necessary.

The first time this is called it will populate the edges for this node in the graph. It does this by scanning the underlying function, so once this is done, any changes to that function must be explicitly reflected in updates to the graph.

Returns
the populated EdgeSequence to simplify walking it.

This will not update or re-scan anything if called repeatedly. Instead, the edge sequence is cached and returned immediately on subsequent calls.

Definition at line 376 of file LazyCallGraph.h.

References clear(), F(), G, and llvm::Optional< T >::reset().

Referenced by llvm::LazyCallGraph::buildRefSCCs(), printNode(), and printNodeDOT().

Friends And Related Function Documentation

◆ LazyCallGraph

friend class LazyCallGraph
friend

Definition at line 328 of file LazyCallGraph.h.

◆ LazyCallGraph::RefSCC

friend class LazyCallGraph::RefSCC
friend

Definition at line 329 of file LazyCallGraph.h.

◆ operator<<

raw_ostream& operator<< ( raw_ostream OS,
const Node N 
)
friend

Print the name of this node's function.

Definition at line 412 of file LazyCallGraph.h.


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