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) |
CallGraphNode * | getExternalCallingNode () const |
CallGraphNode * | getCallsExternalNode () const |
CallGraphNode * | getRoot () |
const CallGraphNode * | getRoot () const |
Function * | removeFunctionFromModule (CallGraphNode *CGN) |
CallGraphNode * | getOrInsertFunction (const Function *F) |
CallGraph () | |
virtual | ~CallGraph () |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
virtual bool | runOnModule (Module &M) |
virtual void | releaseMemory () |
void | print (raw_ostream &o, const Module *) const |
void | dump () const |
![]() | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a module printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
ModulePass (char &pid) | |
virtual | ~ModulePass () |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual const char * | getPassName () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doInitialization (Module &) |
virtual bool | doFinalization (Module &) |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Additional Inherited Members | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Definition at line 72 of file CallGraph.h.
typedef FunctionMapTy::const_iterator llvm::CallGraph::const_iterator |
Definition at line 108 of file CallGraph.h.
typedef FunctionMapTy::iterator llvm::CallGraph::iterator |
Definition at line 107 of file CallGraph.h.
CallGraph::CallGraph | ( | ) |
Definition at line 19 of file CallGraph.cpp.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeCallGraphPass().
|
inlinevirtual |
Definition at line 161 of file CallGraph.h.
References releaseMemory().
|
inline |
Definition at line 114 of file CallGraph.h.
Referenced by llvm::GraphTraits< CallGraph * >::nodes_begin(), llvm::GraphTraits< const CallGraph * >::nodes_begin(), print(), and llvm::Inliner::removeDeadFunctions().
|
inline |
Definition at line 116 of file CallGraph.h.
void CallGraph::dump | ( | ) | const |
Definition at line 129 of file CallGraph.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 115 of file CallGraph.h.
Referenced by llvm::GraphTraits< CallGraph * >::nodes_end(), llvm::GraphTraits< const CallGraph * >::nodes_end(), print(), and llvm::Inliner::removeDeadFunctions().
|
inline |
Definition at line 117 of file CallGraph.h.
|
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 65 of file CallGraph.cpp.
References llvm::AnalysisUsage::setPreservesAll().
|
inline |
Definition at line 135 of file CallGraph.h.
|
inline |
Returns the CallGraphNode which is used to represent undetermined calls into the callgraph.
Definition at line 134 of file CallGraph.h.
Referenced by llvm::GraphTraits< CallGraph * >::getEntryNode(), llvm::GraphTraits< const CallGraph * >::getEntryNode(), and llvm::Inliner::removeDeadFunctions().
|
inline |
getModule - Return the module the call graph corresponds to.
Definition at line 112 of file CallGraph.h.
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 173 of file CallGraph.cpp.
References F(), and llvm::GlobalValue::getParent().
Referenced by runOnModule().
|
inline |
Return the root/main method in the module, or some other root node, such as the externalcallingnode.
Definition at line 139 of file CallGraph.h.
|
inline |
Definition at line 140 of file CallGraph.h.
|
inline |
Definition at line 121 of file CallGraph.h.
References I.
|
inline |
Definition at line 126 of file CallGraph.h.
References I.
|
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 117 of file CallGraph.cpp.
References begin(), end(), llvm::CallGraphNode::getFunction(), llvm::Value::getName(), and I.
Referenced by dump().
|
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.
CallsExternalNode is not in the function map, delete it explicitly.
Reimplemented from llvm::Pass.
Definition at line 92 of file CallGraph.cpp.
References I.
Referenced by ~CallGraph().
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 144 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().
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
Implements llvm::ModulePass.
Definition at line 69 of file CallGraph.cpp.
References llvm::Module::begin(), llvm::Module::end(), getOrInsertFunction(), and I.
|
static |
Definition at line 103 of file CallGraph.h.