LLVM API Documentation

Public Types | Public Member Functions
llvm::CallGraph Class Reference

The basic data container for the call graph of a Module of IR. More...

#include <CallGraph.h>

List of all members.

Public Types

typedef FunctionMapTy::iterator iterator
typedef
FunctionMapTy::const_iterator 
const_iterator

Public Member Functions

 CallGraph (Module &M)
 ~CallGraph ()
void print (raw_ostream &OS) const
void dump () const
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.

Detailed Description

The basic data container for the call graph of a Module of IR.

This class exposes both the interface to the call graph for a module of IR.

The core call graph itself can also be updated to reflect changes to the IR.

Definition at line 74 of file CallGraph.h.


Member Typedef Documentation

typedef FunctionMapTy::const_iterator llvm::CallGraph::const_iterator

Definition at line 113 of file CallGraph.h.

typedef FunctionMapTy::iterator llvm::CallGraph::iterator

Definition at line 112 of file CallGraph.h.


Constructor & Destructor Documentation

Definition at line 23 of file CallGraph.cpp.

References llvm::Module::begin(), llvm::Module::end(), and I.

Definition at line 35 of file CallGraph.cpp.

References I.


Member Function Documentation

Definition at line 120 of file CallGraph.h.

void CallGraph::dump ( ) const

Definition at line 106 of file CallGraph.cpp.

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

Definition at line 121 of file CallGraph.h.

Definition at line 141 of file CallGraph.h.

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

Definition at line 139 of file CallGraph.h.

Referenced by llvm::GraphTraits< CallGraph * >::getEntryNode(), llvm::GraphTraits< const CallGraph * >::getEntryNode(), and llvm::Inliner::removeDeadFunctions().

Module& llvm::CallGraph::getModule ( ) const [inline]

Returns the module the call graph corresponds to.

Definition at line 116 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 144 of file CallGraph.cpp.

References F(), and llvm::GlobalValue::getParent().

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

Returns the call graph node for the provided function.

Definition at line 124 of file CallGraph.h.

References I.

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

Returns the call graph node for the provided function.

Definition at line 131 of file CallGraph.h.

References I.

void CallGraph::print ( raw_ostream OS) const

Definition at line 93 of file CallGraph.cpp.

References begin(), end(), llvm::CallGraphNode::getFunction(), llvm::Value::getName(), and I.

Referenced by dump().

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 115 of file CallGraph.cpp.

References llvm::CallGraphNode::empty(), F(), llvm::CallGraphNode::getFunction(), llvm::Module::getFunctionList(), and llvm::iplist< NodeTy, Traits >::remove().

Referenced by llvm::Inliner::removeDeadFunctions(), and llvm::Inliner::runOnSCC().


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