Home | History | Annotate | Download | only in IPA

Lines Matching refs:Function

30   // Root is root of the call graph, or the external node if a 'main' function
40 // indirect calls or calling an external function.
58 // Add every function to the call graph.
62 // If we didn't find a main function, use the external call graph node
74 if (Function *F = getRoot()->getFunction())
77 OS << "<<null function: 0x" << getRoot() << ">>\n";
111 // addToCallGraph - Add a function to the call graph, and link the node to all
114 void addToCallGraph(Function *F) {
117 // If this function has external linkage, anything could call it.
130 // Loop over all of the users of the function, looking for non-call uses.
141 // If this function is not defined in this translation unit, it could call
146 // Look for calls by this function.
147 for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB)
152 const Function *Callee = CS.getCalledFunction();
164 /// CallsExternalNode is not in the function map, delete it explicitly.
216 // removeFunctionFromModule - Unlink the function from this module, returning
217 // it. Because this removes the function from the module, the call graph node
218 // is destroyed. This is only valid if the function does not call any other
222 Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
223 assert(CGN->empty() && "Cannot remove function from call "
225 Function *F = CGN->getFunction(); // Get the function for the call graph node
233 /// spliceFunction - Replace the function represented by this node by another.
234 /// This does not rescan the body of the function, so it is suitable when
235 /// splicing the body of the old function to the new while also updating all
238 void CallGraph::spliceFunction(const Function *From, const Function *To) {
239 assert(FunctionMap.count(From) && "No CallGraphNode for function!");
241 "Pointing CallGraphNode at a function that already exists");
243 I->second->F = const_cast<Function*>(To);
249 // it will insert a new CallGraphNode for the specified function if one does
251 CallGraphNode *CallGraph::getOrInsertFunction(const Function *F) {
255 assert((!F || F->getParent() == Mod) && "Function not in current module!");
256 return CGN = new CallGraphNode(const_cast<Function*>(F));
260 if (Function *F = getFunction())
261 OS << "Call graph node for function: '" << F->getName() << "'";
263 OS << "Call graph node <<null function>>";
269 if (Function *FI = I->second->getFunction())
270 OS << "function '" << FI->getName() <<"'\n";
295 // the specified callee function. This takes more time to execute than
308 /// from this node to the specified callee function.