class LazyCallGraph::Node

Declaration

class LazyCallGraph::Node { /* full declaration omitted */ };

Description

A node in the call graph. This represents a single node. Its 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 >`.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:315

Member Variables

private llvm::LazyCallGraph* G
private llvm::Function* F
private int DFSNumber = 0
private Optional<llvm::LazyCallGraph::EdgeSequence> Edges

Method Overview

Methods

Node(llvm::LazyCallGraph& G, llvm::Function& F)

Description

Basic constructor implements the scanning of F into Edges and EdgeIndexMap.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:385

Parameters

llvm::LazyCallGraph& G
llvm::Function& F

void clear()

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:397

void dump() const

Description

Dump the name of this node's function to stderr.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:405

llvm::Function& getFunction() const

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:322

llvm::LazyCallGraph& getGraph() const

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:320

llvm::StringRef getName() const

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:324

bool isDead() const

Description

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.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:338

bool isPopulated() const

Description

Tests whether the node has been populated with edges.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:331

llvm::LazyCallGraph::EdgeSequence& populate()

Description

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. This will not update or re-scan anything if called repeatedly. Instead, the edge sequence is cached and returned immediately on subsequent calls.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:364

Returns

the populated \c EdgeSequence to simplify walking it.

llvm::LazyCallGraph::EdgeSequence& populateSlow()

Description

Implementation of the scan when populating.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:388

void replaceFunction(llvm::Function& NewF)

Description

Internal helper to directly replace the function with a new one. This is used to facilitate transformations which need to replace the formal Function object but directly move the body and users from one to the other.

Declared at: llvm/include/llvm/Analysis/LazyCallGraph.h:395

Parameters

llvm::Function& NewF