Lines Matching refs:Function
13 // Every function in a module is represented as a node in the call graph. The
14 // callgraph node keeps track of which functions the are called by the function
17 // A call graph may contain nodes where the function that they correspond to is
31 // 1. The function is external, reflecting the fact that they could call
33 // 2. The function contains an indirect function call.
36 // function. These will be used when we can prove (through pointer analysis)
44 // CallGraph is, which it currently does by looking for a function named 'main'.
45 // If no function named 'main' is found, the external node is used as the entry
46 // node, reflecting the fact that any function without internal linkage could
54 #include "llvm/Function.h"
65 class Function;
76 typedef std::map<const Function *, CallGraphNode *> FunctionMapTy;
77 FunctionMapTy FunctionMap; // Map from a function to its node
97 // function
98 inline const CallGraphNode *operator[](const Function *F) const {
100 assert(I != FunctionMap.end() && "Function not in callgraph!");
103 inline CallGraphNode *operator[](const Function *F) {
105 assert(I != FunctionMap.end() && "Function not in callgraph!");
121 // Functions to keep a call graph up to date with a function that has been
125 /// removeFunctionFromModule - Unlink the function from this module, returning
126 /// it. Because this removes the function from the module, the call graph
127 /// node is destroyed. This is only valid if the function does not call any
131 Function *removeFunctionFromModule(CallGraphNode *CGN);
132 Function *removeFunctionFromModule(Function *F) {
137 /// it will insert a new CallGraphNode for the specified function if one does
139 CallGraphNode *getOrInsertFunction(const Function *F);
141 /// spliceFunction - Replace the function represented by this node by another.
142 /// This does not rescan the body of the function, so it is suitable when
143 /// splicing the body of one function to another while also updating all
144 /// callers from the old function to the new.
146 void spliceFunction(const Function *From, const Function *To);
175 AssertingVH<Function> F;
197 // CallGraphNode ctor - Create a node for the specified function.
198 inline CallGraphNode(Function *f) : F(f), NumReferences(0) {}
210 // getFunction - Return the function that this call graph node represents.
211 Function *getFunction() const { return F; }
224 // Subscripting operator - Return the i'th called function.
237 // Methods to keep a call graph up to date with a function that has been
259 /// addCalledFunction - Add a function to the list of functions called by this
282 /// to the specified callee function. This takes more time to execute than
287 /// from this node to the specified callee function.
295 /// allReferencesDropped - This is a special function that should only be
345 typedef std::pair<const Function*, CallGraphNode*> PairTy;