LLVM 19.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::LazyCallGraph::Edge Class Reference

A class used to represent edges in the call graph. More...

#include "llvm/Analysis/LazyCallGraph.h"

Public Types

enum  Kind : bool { Ref = false , Call = true }
 The kind of edge in the graph. More...
 

Public Member Functions

 Edge ()
 
 Edge (Node &N, Kind K)
 
 operator bool () const
 Test whether the edge is null.
 
Kind getKind () const
 Returns the Kind of the edge.
 
bool isCall () const
 Test whether the edge represents a direct call to a function.
 
NodegetNode () const
 Get the call graph node referenced by this edge.
 
FunctiongetFunction () const
 Get the function referenced by this edge.
 

Friends

class LazyCallGraph::EdgeSequence
 
class LazyCallGraph::RefSCC
 

Detailed Description

A class used to represent edges in the call graph.

The lazy call graph models both call edges and reference edges. Call edges are much what you would expect, and exist when there is a 'call' or 'invoke' instruction of some function. Reference edges are also tracked along side these, and exist whenever any instruction (transitively through its operands) references a function. All call edges are inherently reference edges, and so the reference graph forms a superset of the formal call graph.

All of these forms of edges are fundamentally represented as outgoing edges. The edges are stored in the source node and point at the target node. This allows the edge structure itself to be a very compact data structure: essentially a tagged pointer.

Definition at line 131 of file LazyCallGraph.h.

Member Enumeration Documentation

◆ Kind

The kind of edge in the graph.

Enumerator
Ref 
Call 

Definition at line 134 of file LazyCallGraph.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

llvm::LazyCallGraph::Edge::Edge ( )
inlinedefault

◆ Edge() [2/2]

llvm::LazyCallGraph::Edge::Edge ( Node N,
Kind  K 
)
inlineexplicit

Definition at line 1212 of file LazyCallGraph.h.

Member Function Documentation

◆ getFunction()

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

Get the function referenced by this edge.

This requires that the edge is not null.

Definition at line 1233 of file LazyCallGraph.h.

References assert().

◆ getKind()

LazyCallGraph::Edge::Kind llvm::LazyCallGraph::Edge::getKind ( ) const
inline

Returns the Kind of the edge.

Definition at line 1218 of file LazyCallGraph.h.

References assert().

◆ getNode()

LazyCallGraph::Node & llvm::LazyCallGraph::Edge::getNode ( ) const
inline

Get the call graph node referenced by this edge.

This requires that the edge is not null.

Definition at line 1228 of file LazyCallGraph.h.

References assert().

Referenced by llvm::LazyCallGraph::buildRefSCCs().

◆ isCall()

bool llvm::LazyCallGraph::Edge::isCall ( ) const
inline

Test whether the edge represents a direct call to a function.

This requires that the edge is not null.

Definition at line 1223 of file LazyCallGraph.h.

References assert().

Referenced by llvm::LazyCallGraph::addSplitRefRecursiveFunctions(), and llvm::LazyCallGraph::RefSCC::insertTrivialCallEdge().

◆ operator bool()

llvm::LazyCallGraph::Edge::operator bool ( ) const
inlineexplicit

Test whether the edge is null.

This happens when an edge has been deleted. We leave the edge objects around but clear them.

Definition at line 1214 of file LazyCallGraph.h.

Friends And Related Function Documentation

◆ LazyCallGraph::EdgeSequence

friend class LazyCallGraph::EdgeSequence
friend

Definition at line 164 of file LazyCallGraph.h.

◆ LazyCallGraph::RefSCC

friend class LazyCallGraph::RefSCC
friend

Definition at line 165 of file LazyCallGraph.h.


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