class CallGraphNode

Declaration

class CallGraphNode { /* full declaration omitted */ };

Description

A node in the call graph for a module. Typically represents a function in the call graph. There are also special "null" nodes used to represent theoretical entries in the call graph.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:166

Member Variables

private llvm::CallGraph* CG
private llvm::Function* F
private std::vector<CallRecord> CalledFunctions
private unsigned int NumReferences = 0
The number of times that this CallGraphNode occurs in the CalledFunctions array of this or other CallGraphNodes.

Method Overview

Methods

void AddRef()

Declared at: llvm/include/llvm/Analysis/CallGraph.h:293

CallGraphNode(const llvm::CallGraphNode&)

Declared at: llvm/include/llvm/Analysis/CallGraph.h:186

Parameters

const llvm::CallGraphNode&

inline CallGraphNode(llvm::CallGraph* CG,
                     llvm::Function* F)

Description

Creates a node for the specified function.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:184

Parameters

llvm::CallGraph* CG
llvm::Function* F

void DropRef()

Declared at: llvm/include/llvm/Analysis/CallGraph.h:292

void addCalledFunction(llvm::CallBase* Call,
                       llvm::CallGraphNode* M)

Description

Adds a function to the list of functions called by this one.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:242

Parameters

llvm::CallBase* Call
llvm::CallGraphNode* M

void allReferencesDropped()

Description

A special function that should only be used by the CallGraph class.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:296

inline llvm::CallGraphNode::const_iterator begin()
    const

Declared at: llvm/include/llvm/Analysis/CallGraph.h:201

inline llvm::CallGraphNode::iterator begin()

Declared at: llvm/include/llvm/Analysis/CallGraph.h:199

void dump() const

Description

Print out this call graph node.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:217

inline bool empty() const

Declared at: llvm/include/llvm/Analysis/CallGraph.h:203

inline llvm::CallGraphNode::const_iterator end()
    const

Declared at: llvm/include/llvm/Analysis/CallGraph.h:202

inline llvm::CallGraphNode::iterator end()

Declared at: llvm/include/llvm/Analysis/CallGraph.h:200

llvm::Function* getFunction() const

Description

Returns the function that this call graph node represents.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:197

unsigned int getNumReferences() const

Description

Returns the number of other CallGraphNodes in this CallGraph that reference this node in their callee list.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:208

void print(llvm::raw_ostream& OS) const

Declared at: llvm/include/llvm/Analysis/CallGraph.h:218

Parameters

llvm::raw_ostream& OS

void removeAllCalledFunctions()

Description

Removes all edges from this CallGraphNode to any functions it calls.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:227

void removeAnyCallEdgeTo(
    llvm::CallGraphNode* Callee)

Description

Removes all call edges from this node to the specified callee function. This takes more time to execute than removeCallEdgeTo, so it should not be used unless necessary.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:267

Parameters

llvm::CallGraphNode* Callee

void removeCallEdge(
    llvm::CallGraphNode::iterator I)

Declared at: llvm/include/llvm/Analysis/CallGraph.h:251

Parameters

llvm::CallGraphNode::iterator I

void removeCallEdgeFor(llvm::CallBase& Call)

Description

Removes the edge in the node for the specified call site. Note that this method takes linear time, so it should be used sparingly.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:260

Parameters

llvm::CallBase& Call

void removeOneAbstractEdgeTo(
    llvm::CallGraphNode* Callee)

Description

Removes one edge associated with a null callsite from this node to the specified callee function.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:271

Parameters

llvm::CallGraphNode* Callee

void replaceCallEdge(llvm::CallBase& Call,
                     llvm::CallBase& NewCall,
                     llvm::CallGraphNode* NewNode)

Description

Replaces the edge in the node for the specified call site with a new one. Note that this method takes linear time, so it should be used sparingly.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:277

Parameters

llvm::CallBase& Call
llvm::CallBase& NewCall
llvm::CallGraphNode* NewNode

inline unsigned int size() const

Declared at: llvm/include/llvm/Analysis/CallGraph.h:204

void stealCalledFunctionsFrom(
    llvm::CallGraphNode* N)

Description

Moves all the callee information from N to this node.

Declared at: llvm/include/llvm/Analysis/CallGraph.h:235

Parameters

llvm::CallGraphNode* N

~CallGraphNode()

Declared at: llvm/include/llvm/Analysis/CallGraph.h:189