Home | History | Annotate | Download | only in Utils

Lines Matching refs:Function

1 //===- CloneFunction.cpp - Clone a function into another function ---------===//
11 // low-level function cloner. This is used by the CloneFunction and function
12 // inliner to do the dirty work of copying the body of a function around.
22 #include "llvm/Function.h"
36 const Twine &NameSuffix, Function *F,
74 void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
82 for (Function::const_arg_iterator I = OldFunc->arg_begin(),
92 for (Function::const_arg_iterator I = OldFunc->arg_begin(),
106 // Loop over all of the basic blocks in the function, cloning them as
110 for (Function::const_iterator BI = OldFunc->begin(), BE = OldFunc->end();
122 // Loop over all of the instructions in the function, fixing up operand
124 for (Function::iterator BB = cast<BasicBlock>(VMap[OldFunc->begin()]),
132 /// CloneFunction - Return a copy of the specified function, but without
133 /// embedding the function into another module. Also, any references specified
135 /// original one. If any of the arguments to the function are in the VMap,
136 /// the arguments are deleted from the resultant function. The VMap is
138 /// the function from their old to new values.
140 Function *llvm::CloneFunction(const Function *F, ValueToValueMapTy &VMap,
145 // The user might be deleting arguments to the function by specifying them in
148 for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
153 // Create a new function type...
157 // Create the new function...
158 Function *NewF = Function::Create(FTy, F->getLinkage(), F->getName());
161 Function::arg_iterator DestI = NewF->arg_begin();
162 for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();
180 Function *NewFunc;
181 const Function *OldFunc;
189 PruningFunctionCloner(Function *newFunc, const Function *oldFunc,
343 /// example) a function call with constant arguments is inlined, and those
347 void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
358 for (Function::const_arg_iterator II = OldFunc->arg_begin(),
375 // Loop over all of the basic blocks in the old function. If the block was
377 // insert it into the new function in the right order. If not, ignore it.
379 // Defer PHI resolution until rest of function is resolved.
381 for (Function::const_iterator BI = OldFunc->begin(), BE = OldFunc->end();
387 // Add the new block to the new function.
414 // Defer PHI resolution until rest of function is resolved, PHI resolution
500 // Now that the inlined function body has been fully constructed, go through
504 Function::iterator I = cast<BasicBlock>(VMap[&OldFunc->getEntryBlock()]);
518 // We know all single-entry PHI nodes in the inlined function have been