|
LLVM
10.0.0
|
A node in the call graph for a module. More...
#include "llvm/Analysis/CallGraph.h"
Public Types | |
| using | CallRecord = std::pair< WeakTrackingVH, CallGraphNode * > |
| A pair of the calling instruction (a call or invoke) and the call graph node being called. More... | |
| using | CalledFunctionsVector = std::vector< CallRecord > |
| using | iterator = std::vector< CallRecord >::iterator |
| using | const_iterator = std::vector< CallRecord >::const_iterator |
Public Member Functions | |
| CallGraphNode (Function *F) | |
| Creates a node for the specified function. More... | |
| CallGraphNode (const CallGraphNode &)=delete | |
| CallGraphNode & | operator= (const CallGraphNode &)=delete |
| ~CallGraphNode () | |
| Function * | getFunction () const |
| Returns the function that this call graph node represents. More... | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| bool | empty () const |
| unsigned | size () const |
| unsigned | getNumReferences () const |
| Returns the number of other CallGraphNodes in this CallGraph that reference this node in their callee list. More... | |
| CallGraphNode * | operator[] (unsigned i) const |
| Returns the i'th called function. More... | |
| void | dump () const |
| Print out this call graph node. More... | |
| void | print (raw_ostream &OS) const |
| void | removeAllCalledFunctions () |
| Removes all edges from this CallGraphNode to any functions it calls. More... | |
| void | stealCalledFunctionsFrom (CallGraphNode *N) |
| Moves all the callee information from N to this node. More... | |
| void | addCalledFunction (CallBase *Call, CallGraphNode *M) |
| Adds a function to the list of functions called by this one. More... | |
| void | removeCallEdge (iterator I) |
| void | removeCallEdgeFor (CallBase &Call) |
| Removes the edge in the node for the specified call site. More... | |
| void | removeAnyCallEdgeTo (CallGraphNode *Callee) |
| Removes all call edges from this node to the specified callee function. More... | |
| void | removeOneAbstractEdgeTo (CallGraphNode *Callee) |
| Removes one edge associated with a null callsite from this node to the specified callee function. More... | |
| void | replaceCallEdge (CallBase &Call, CallBase &NewCall, CallGraphNode *NewNode) |
| Replaces the edge in the node for the specified call site with a new one. More... | |
Friends | |
| class | CallGraph |
A node in the call graph for a module.
Typically represents a function in the call graph. There are also special "null" nodes used to represent theoretical entries in the call graph.
Definition at line 164 of file CallGraph.h.
| using llvm::CallGraphNode::CalledFunctionsVector = std::vector<CallRecord> |
Definition at line 171 of file CallGraph.h.
| using llvm::CallGraphNode::CallRecord = std::pair<WeakTrackingVH, CallGraphNode *> |
A pair of the calling instruction (a call or invoke) and the call graph node being called.
Definition at line 168 of file CallGraph.h.
| using llvm::CallGraphNode::const_iterator = std::vector<CallRecord>::const_iterator |
Definition at line 184 of file CallGraph.h.
| using llvm::CallGraphNode::iterator = std::vector<CallRecord>::iterator |
Definition at line 183 of file CallGraph.h.
|
inline |
Creates a node for the specified function.
Definition at line 174 of file CallGraph.h.
|
delete |
|
inline |
Definition at line 179 of file CallGraph.h.
References assert().
|
inline |
Adds a function to the list of functions called by this one.
Definition at line 232 of file CallGraph.h.
References assert(), llvm::CallBase::getCalledFunction(), llvm::Function::getIntrinsicID(), llvm::Function::isIntrinsic(), and llvm::Intrinsic::isLeaf().
Referenced by replacePrepare(), and UpdateCallGraphAfterInlining().
|
inline |
Definition at line 189 of file CallGraph.h.
Referenced by llvm::GraphTraits< CallGraphNode * >::child_begin(), llvm::GraphTraits< const CallGraphNode * >::child_begin(), llvm::GraphTraits< const CallGraphNode * >::child_edge_begin(), and UpdateCallGraphAfterInlining().
|
inline |
Definition at line 191 of file CallGraph.h.
| LLVM_DUMP_METHOD void CallGraphNode::dump | ( | ) | const |
Print out this call graph node.
Definition at line 181 of file CallGraph.cpp.
References llvm::dbgs(), and llvm::CallGraph::print().
|
inline |
Definition at line 193 of file CallGraph.h.
Referenced by llvm::CallGraph::removeFunctionFromModule().
|
inline |
Definition at line 190 of file CallGraph.h.
Referenced by llvm::GraphTraits< const CallGraphNode * >::child_edge_end(), llvm::GraphTraits< CallGraphNode * >::child_end(), llvm::GraphTraits< const CallGraphNode * >::child_end(), and UpdateCallGraphAfterInlining().
|
inline |
Definition at line 192 of file CallGraph.h.
|
inline |
Returns the function that this call graph node represents.
Definition at line 187 of file CallGraph.h.
References F().
Referenced by llvm::CallGraphSCCPass::getAnalysisUsage(), getDescription(), llvm::CallGraph::print(), llvm::LegacyInlinerBase::removeDeadFunctions(), llvm::CallGraph::removeFunctionFromModule(), and llvm::SyntheticCountsPropagation::run().
|
inline |
Returns the number of other CallGraphNodes in this CallGraph that reference this node in their callee list.
Definition at line 198 of file CallGraph.h.
|
delete |
|
inline |
Returns the i'th called function.
Definition at line 201 of file CallGraph.h.
References assert(), llvm::CallGraph::dump(), and llvm::CallGraph::print().
| void CallGraphNode::print | ( | raw_ostream & | OS | ) | const |
Definition at line 162 of file CallGraph.cpp.
References getFunction(), llvm::Value::getName(), and I.
|
inline |
Removes all edges from this CallGraphNode to any functions it calls.
Definition at line 217 of file CallGraph.h.
| void CallGraphNode::removeAnyCallEdgeTo | ( | CallGraphNode * | Callee | ) |
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 202 of file CallGraph.cpp.
References llvm::numbers::e, and second.
Referenced by llvm::LegacyInlinerBase::removeDeadFunctions().
|
inline |
Definition at line 240 of file CallGraph.h.
References Callee.
| void CallGraphNode::removeCallEdgeFor | ( | CallBase & | Call | ) |
Removes the edge in the node for the specified call site.
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 187 of file CallGraph.cpp.
Referenced by DeleteBasicBlock(), replacePrepare(), and UpdateCallGraphAfterInlining().
| void CallGraphNode::removeOneAbstractEdgeTo | ( | CallGraphNode * | Callee | ) |
Removes one edge associated with a null callsite from this node to the specified callee function.
removeOneAbstractEdgeTo - Remove one edge associated with a null callsite from this node to the specified callee function.
Definition at line 214 of file CallGraph.cpp.
Referenced by llvm::InternalizePass::internalizeModule().
| void CallGraphNode::replaceCallEdge | ( | CallBase & | Call, |
| CallBase & | NewCall, | ||
| CallGraphNode * | NewNode | ||
| ) |
Replaces the edge in the node for the specified call site with a new one.
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 230 of file CallGraph.cpp.
Referenced by llvm::createArgumentPromotionPass().
|
inline |
Definition at line 194 of file CallGraph.h.
|
inline |
Moves all the callee information from N to this node.
Definition at line 225 of file CallGraph.h.
References assert(), and std::swap().
Referenced by llvm::createArgumentPromotionPass().
|
friend |
Definition at line 270 of file CallGraph.h.
1.8.13