LLVM API Documentation

Public Types | Public Member Functions | Static Public Attributes
llvm::CallGraphWrapperPass Class Reference

The ModulePass which wraps up a CallGraph and the logic to build it. More...

#include <CallGraph.h>

Inheritance diagram for llvm::CallGraphWrapperPass:
Inheritance graph
[legend]
Collaboration diagram for llvm::CallGraphWrapperPass:
Collaboration graph
[legend]

List of all members.

Public Types

typedef CallGraph::iterator iterator
typedef CallGraph::const_iterator const_iterator

Public Member Functions

 CallGraphWrapperPass ()
virtual ~CallGraphWrapperPass ()
const CallGraphgetCallGraph () const
 The internal CallGraph around which the rest of this interface is wrapped.
CallGraphgetCallGraph ()
ModulegetModule () const
 Returns the module the call graph corresponds to.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
const CallGraphNodeoperator[] (const Function *F) const
 Returns the call graph node for the provided function.
CallGraphNodeoperator[] (const Function *F)
 Returns the call graph node for the provided function.
CallGraphNodegetExternalCallingNode () const
 Returns the CallGraphNode which is used to represent undetermined calls into the callgraph.
CallGraphNodegetCallsExternalNode () const
FunctionremoveFunctionFromModule (CallGraphNode *CGN)
 Unlink the function from this module, returning it.
CallGraphNodegetOrInsertFunction (const Function *F)
 Similar to operator[], but this will insert a new CallGraphNode for F if one does not already exist.
void getAnalysisUsage (AnalysisUsage &AU) const override
bool runOnModule (Module &M) override
void releaseMemory () override
void print (raw_ostream &o, const Module *) const override
void dump () const

Static Public Attributes

static char ID

Detailed Description

The ModulePass which wraps up a 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 CallGraph object which is stored internally for each module.

Definition at line 314 of file CallGraph.h.


Member Typedef Documentation

Definition at line 329 of file CallGraph.h.

Definition at line 328 of file CallGraph.h.


Constructor & Destructor Documentation

Definition at line 253 of file CallGraph.cpp.


Member Function Documentation

Definition at line 334 of file CallGraph.h.

Definition at line 336 of file CallGraph.h.

Reimplemented from llvm::Pass.

Definition at line 283 of file CallGraph.cpp.

References llvm::dbgs(), and print().

Definition at line 335 of file CallGraph.h.

Definition at line 337 of file CallGraph.h.

void CallGraphWrapperPass::getAnalysisUsage ( AnalysisUsage ) const [override, virtual]

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.

Reimplemented from llvm::Pass.

Definition at line 255 of file CallGraph.cpp.

References llvm::AnalysisUsage::setPreservesAll().

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

Definition at line 325 of file CallGraph.h.

Referenced by llvm::AnalysisCallGraphWrapperPassTraits::getGraph().

Definition at line 326 of file CallGraph.h.

Definition at line 353 of file CallGraph.h.

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

Definition at line 349 of file CallGraph.h.

Returns the module the call graph corresponds to.

Definition at line 332 of file CallGraph.h.

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

Definition at line 374 of file CallGraph.h.

const CallGraphNode* llvm::CallGraphWrapperPass::operator[] ( const Function F) const [inline]

Returns the call graph node for the provided function.

Definition at line 340 of file CallGraph.h.

References F().

CallGraphNode* llvm::CallGraphWrapperPass::operator[] ( const Function F) [inline]

Returns the call graph node for the provided function.

Definition at line 345 of file CallGraph.h.

References F().

void CallGraphWrapperPass::print ( raw_ostream O,
const Module M 
) const [override, virtual]

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.

Reimplemented from llvm::Pass.

Definition at line 272 of file CallGraph.cpp.

Referenced by dump().

void llvm::CallGraphWrapperPass::releaseMemory ( ) [override, virtual]

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.

Reimplemented from llvm::Pass.

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.

Definition at line 368 of file CallGraph.h.

bool CallGraphWrapperPass::runOnModule ( Module M) [override, virtual]

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

Implements llvm::ModulePass.

Definition at line 259 of file CallGraph.cpp.


Member Data Documentation

Definition at line 318 of file CallGraph.h.


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