LLVM API Documentation
#include <CallGraph.h>

Public Types | |
| typedef FunctionMapTy::iterator | iterator |
| typedef FunctionMapTy::const_iterator | const_iterator |
Public Member Functions | |
| Module & | getModule () const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const CallGraphNode * | operator[] (const Function *F) const |
| CallGraphNode * | operator[] (const Function *F) |
| virtual CallGraphNode * | getExternalCallingNode () const |
| virtual CallGraphNode * | getRoot () |
| virtual const CallGraphNode * | getRoot () const |
| Function * | removeFunctionFromModule (CallGraphNode *CGN) |
| Function * | removeFunctionFromModule (Function *F) |
| void | changeFunction (Function *OldF, Function *NewF) |
| CallGraphNode * | getOrInsertFunction (const Function *F) |
| virtual | ~CallGraph () |
| void | initialize (Module &M) |
| virtual void | print (std::ostream &o, const Module *M) const |
| void | print (std::ostream *o, const Module *M) const |
| void | dump () const |
Static Public Attributes | |
| static char | ID = 0 |
Protected Types | |
| typedef std::map< const Function *, CallGraphNode * > | FunctionMapTy |
Protected Member Functions | |
| CallGraph () | |
| virtual void | destroy () |
Protected Attributes | |
| Module * | Mod |
| FunctionMapTy | FunctionMap |
Definition at line 70 of file CallGraph.h.
typedef std::map<const Function *, CallGraphNode *> llvm::CallGraph::FunctionMapTy [protected] |
Definition at line 74 of file CallGraph.h.
| typedef FunctionMapTy::iterator llvm::CallGraph::iterator |
Definition at line 82 of file CallGraph.h.
| typedef FunctionMapTy::const_iterator llvm::CallGraph::const_iterator |
Definition at line 83 of file CallGraph.h.
| llvm::CallGraph::CallGraph | ( | ) | [inline, protected] |
Definition at line 148 of file CallGraph.h.
| virtual llvm::CallGraph::~CallGraph | ( | ) | [inline, virtual] |
| Module& llvm::CallGraph::getModule | ( | ) | const [inline] |
getModule - Return the module the call graph corresponds to.
Definition at line 87 of file CallGraph.h.
References Mod.
| iterator llvm::CallGraph::begin | ( | ) | [inline] |
Definition at line 89 of file CallGraph.h.
References FunctionMap.
Referenced by llvm::GraphTraits< const CallGraph * >::nodes_begin(), llvm::GraphTraits< CallGraph * >::nodes_begin(), print(), and llvm::Inliner::removeDeadFunctions().
| iterator llvm::CallGraph::end | ( | ) | [inline] |
Definition at line 90 of file CallGraph.h.
References FunctionMap.
Referenced by llvm::GraphTraits< const CallGraph * >::nodes_end(), llvm::GraphTraits< CallGraph * >::nodes_end(), print(), and llvm::Inliner::removeDeadFunctions().
| const_iterator llvm::CallGraph::begin | ( | ) | const [inline] |
| const_iterator llvm::CallGraph::end | ( | ) | const [inline] |
| const CallGraphNode* llvm::CallGraph::operator[] | ( | const Function * | F | ) | const [inline] |
| CallGraphNode* llvm::CallGraph::operator[] | ( | const Function * | F | ) | [inline] |
| virtual CallGraphNode* llvm::CallGraph::getExternalCallingNode | ( | ) | const [inline, virtual] |
Returns the CallGraphNode which is used to represent undetermined calls into the callgraph. Override this if you want behavioral inheritance.
Definition at line 109 of file CallGraph.h.
Referenced by llvm::GraphTraits< const CallGraph * >::getEntryNode(), llvm::GraphTraits< CallGraph * >::getEntryNode(), and llvm::Inliner::removeDeadFunctions().
| virtual CallGraphNode* llvm::CallGraph::getRoot | ( | ) | [inline, virtual] |
Return the root/main method in the module, or some other root node, such as the externalcallingnode. Overload these if you behavioral inheritance.
Definition at line 114 of file CallGraph.h.
| virtual const CallGraphNode* llvm::CallGraph::getRoot | ( | ) | const [inline, virtual] |
Definition at line 115 of file CallGraph.h.
| Function * CallGraph::removeFunctionFromModule | ( | CallGraphNode * | CGN | ) |
removeFunctionFromModule - 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 207 of file CallGraph.cpp.
References llvm::CallGraphNode::CalledFunctions, FunctionMap, llvm::CallGraphNode::getFunction(), llvm::Module::getFunctionList(), and Mod.
Referenced by InlineCallIfPossible(), llvm::Inliner::removeDeadFunctions(), and removeFunctionFromModule().
changeFunction - This method changes the function associated with this CallGraphNode, for use by transformations that need to change the prototype of a Function (thus they must create a new Function and move the old code over).
Definition at line 222 of file CallGraph.cpp.
References llvm::CallGraphNode::F, FunctionMap, and I.
| CallGraphNode * CallGraph::getOrInsertFunction | ( | const Function * | F | ) |
getOrInsertFunction - This method is identical to calling operator[], but it will insert a new CallGraphNode for the specified function if one does not already exist.
Definition at line 235 of file CallGraph.cpp.
References FunctionMap, llvm::GlobalValue::getParent(), and Mod.
Referenced by llvm::InlineFunction().
| void CallGraph::initialize | ( | Module & | M | ) |
initialize - Call this method before calling other methods, re/initializes the state of the CallGraph.
Definition at line 175 of file CallGraph.cpp.
References Mod.
| void CallGraph::print | ( | std::ostream & | o, | |
| const Module * | M | |||
| ) | const [virtual] |
| void llvm::CallGraph::print | ( | std::ostream * | o, | |
| const Module * | M | |||
| ) | const [inline] |
| void CallGraph::dump | ( | ) | const |
| void CallGraph::destroy | ( | ) | [protected, virtual] |
Definition at line 179 of file CallGraph.cpp.
References E, FunctionMap, and I.
Referenced by ~CallGraph().
Module* llvm::CallGraph::Mod [protected] |
Definition at line 72 of file CallGraph.h.
Referenced by getModule(), getOrInsertFunction(), initialize(), and removeFunctionFromModule().
FunctionMapTy llvm::CallGraph::FunctionMap [protected] |
Definition at line 75 of file CallGraph.h.
Referenced by begin(), changeFunction(), destroy(), end(), getOrInsertFunction(), operator[](), and removeFunctionFromModule().
char CallGraph::ID = 0 [static] |
Definition at line 78 of file CallGraph.h.
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.