class CallGraphWrapperPass

Declaration

class CallGraphWrapperPass : public ModulePass { /* full declaration omitted */ };

Description

The \c ModulePass which wraps up a \c CallGraph and the logic to build it. This class exposes both the interface to the call graph container and the module pass which runs over a module of IR and produces the call graph. The call graph interface is entirelly a wrapper around a \c CallGraph object which is stored internally for each module.

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

Inherits from: ModulePass

Member Variables

public static char ID

Method Overview

Inherited from ModulePass:

Inherited from Pass:

Methods

CallGraphWrapperPass()

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

inline llvm::CallGraphWrapperPass::iterator
begin()

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

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

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

void dump() const

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

inline llvm::CallGraphWrapperPass::iterator end()

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

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

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

void getAnalysisUsage(
    llvm::AnalysisUsage& AU) const

Description

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis <AnalysisType >() function, below.

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

Parameters

llvm::AnalysisUsage& AU

const llvm::CallGraph& getCallGraph() const

Description

The internal \c CallGraph around which the rest of this interface is wrapped.

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

llvm::CallGraph& getCallGraph()

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

llvm::CallGraphNode* getCallsExternalNode() const

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

llvm::CallGraphNode* getExternalCallingNode()
    const

Description

Returns the \c CallGraphNode which is used to represent undetermined calls into the callgraph.

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

llvm::Module& getModule() const

Description

Returns the module the call graph corresponds to.

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

llvm::CallGraphNode* getOrInsertFunction(
    const llvm::Function* F)

Description

Similar to operator[], but this will insert a new CallGraphNode for\c F if one does not already exist.

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

Parameters

const llvm::Function* F

void print(llvm::raw_ostream& o,
           const llvm::Module*) const

Description

print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.

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

Parameters

llvm::raw_ostream& o
const llvm::Module*

void releaseMemory()

Description

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused. Optionally implement this function to release pass memory when it is no longer used.

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

llvm::Function* removeFunctionFromModule(
    llvm::CallGraphNode* CGN)

Description

Unlink the function from this module, returning it. Because this removes the function from the module, the call graph node is destroyed. This is only valid if the function does not call any other functions (ie, there are no edges in it's CGN). The easiest way to do this is to dropAllReferences before calling this.

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

Parameters

llvm::CallGraphNode* CGN

bool runOnModule(llvm::Module& M)

Description

runOnModule - Virtual method overriden by subclasses to process the module being operated on.

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

Parameters

llvm::Module& M

~CallGraphWrapperPass()

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