LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
llvm::CallGraphNode Class Reference

#include <CallGraph.h>

Public Types

typedef std::pair< WeakVH,
CallGraphNode * > 
CallRecord
 
typedef std::vector< CallRecordCalledFunctionsVector
 
typedef std::vector
< CallRecord >::iterator 
iterator
 
typedef std::vector
< CallRecord >::const_iterator 
const_iterator
 

Public Member Functions

 CallGraphNode (Function *f)
 
 ~CallGraphNode ()
 
FunctiongetFunction () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
unsigned size () const
 
unsigned getNumReferences () const
 
CallGraphNodeoperator[] (unsigned i) const
 
void dump () const
 
void print (raw_ostream &OS) const
 
void removeAllCalledFunctions ()
 
void stealCalledFunctionsFrom (CallGraphNode *N)
 
void addCalledFunction (CallSite CS, CallGraphNode *M)
 
void removeCallEdge (iterator I)
 
void removeCallEdgeFor (CallSite CS)
 
void removeAnyCallEdgeTo (CallGraphNode *Callee)
 
void removeOneAbstractEdgeTo (CallGraphNode *Callee)
 
void replaceCallEdge (CallSite CS, CallSite NewCS, CallGraphNode *NewNode)
 
void allReferencesDropped ()
 

Friends

class CallGraph
 

Detailed Description

Definition at line 173 of file CallGraph.h.

Member Typedef Documentation

Definition at line 195 of file CallGraph.h.

Definition at line 181 of file CallGraph.h.

Definition at line 209 of file CallGraph.h.

Definition at line 208 of file CallGraph.h.

Constructor & Destructor Documentation

llvm::CallGraphNode::CallGraphNode ( Function f)
inline

Definition at line 199 of file CallGraph.h.

llvm::CallGraphNode::~CallGraphNode ( )
inline

Definition at line 200 of file CallGraph.h.

Member Function Documentation

void llvm::CallGraphNode::addCalledFunction ( CallSite  CS,
CallGraphNode M 
)
inline
void llvm::CallGraphNode::allReferencesDropped ( )
inline

allReferencesDropped - This is a special function that should only be used by the CallGraph class.

Definition at line 298 of file CallGraph.h.

iterator llvm::CallGraphNode::begin ( )
inline
const_iterator llvm::CallGraphNode::begin ( ) const
inline

Definition at line 216 of file CallGraph.h.

void CallGraphNode::dump ( ) const

dump - Print out this call graph node.

Definition at line 200 of file CallGraph.cpp.

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

bool llvm::CallGraphNode::empty ( ) const
inline

Definition at line 218 of file CallGraph.h.

Referenced by llvm::CallGraph::removeFunctionFromModule().

iterator llvm::CallGraphNode::end ( )
inline
const_iterator llvm::CallGraphNode::end ( ) const
inline

Definition at line 217 of file CallGraph.h.

Function* llvm::CallGraphNode::getFunction ( ) const
inline
unsigned llvm::CallGraphNode::getNumReferences ( ) const
inline

getNumReferences - Return the number of other CallGraphNodes in this CallGraph that reference this node in their callee list.

Definition at line 223 of file CallGraph.h.

Referenced by print().

CallGraphNode* llvm::CallGraphNode::operator[] ( unsigned  i) const
inline

Definition at line 227 of file CallGraph.h.

void CallGraphNode::print ( raw_ostream OS) const

Definition at line 181 of file CallGraph.cpp.

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

Referenced by dump().

void llvm::CallGraphNode::removeAllCalledFunctions ( )
inline

removeAllCalledFunctions - As the name implies, this removes all edges from this CallGraphNode to any functions it calls.

Definition at line 244 of file CallGraph.h.

Referenced by llvm::Inliner::removeDeadFunctions().

void CallGraphNode::removeAnyCallEdgeTo ( CallGraphNode Callee)

removeAnyCallEdgeTo - This method removes all call edges from this node to the specified callee function. This takes more time to execute than removeCallEdgeTo, so it should not be used unless necessary.

Definition at line 221 of file CallGraph.cpp.

Referenced by llvm::Inliner::removeDeadFunctions().

void llvm::CallGraphNode::removeCallEdge ( iterator  I)
inline

Definition at line 270 of file CallGraph.h.

void CallGraphNode::removeCallEdgeFor ( CallSite  CS)

removeCallEdgeFor - This method removes the edge in the node for the specified call site. Note that this method takes linear time, so it should be used sparingly.

Definition at line 206 of file CallGraph.cpp.

References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), and I.

Referenced by UpdateCallGraphAfterInlining().

void CallGraphNode::removeOneAbstractEdgeTo ( CallGraphNode Callee)

removeOneAbstractEdgeTo - Remove one edge associated with a null callsite from this node to the specified callee function.

Definition at line 233 of file CallGraph.cpp.

References I.

void CallGraphNode::replaceCallEdge ( CallSite  CS,
CallSite  NewCS,
CallGraphNode NewNode 
)

replaceCallEdge - This method replaces the edge in the node for the specified call site with a new one. Note that this method takes linear time, so it should be used sparingly.

Definition at line 249 of file CallGraph.cpp.

References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), and I.

unsigned llvm::CallGraphNode::size ( ) const
inline

Definition at line 219 of file CallGraph.h.

void llvm::CallGraphNode::stealCalledFunctionsFrom ( CallGraphNode N)
inline

stealCalledFunctionsFrom - Move all the callee information from N to this node.

Definition at line 253 of file CallGraph.h.

References std::swap().

Friends And Related Function Documentation

friend class CallGraph
friend

Definition at line 174 of file CallGraph.h.


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