Home | History | Annotate | Download | only in Utils

Lines Matching refs:Function

1 //===- InlineFunction.cpp - Code to perform function inlining -------------===//
10 // This file implements inlining of a function into a call site, resolving
71 /// unwind edges introduced for calls within the inlined function.
159 /// invokes. This function analyze BB to see if there are any calls, and if so,
178 // We only need to check for function calls: inlined invoke
186 // Convert this function call into an invoke instruction. First, split the
219 /// in the body of the inlined function into invokes.
222 /// block of the inlined code (the last block is the end of the function),
228 Function *Caller = FirstNewBlock->getParent();
230 // The inlined code is currently at the end of the function, scan from the
245 for (Function::iterator BB = FirstNewBlock, E = Caller->end(); BB != E; ++BB){
269 Function::iterator FirstNewBlock,
273 const Function *Caller = CS.getInstruction()->getParent()->getParent();
274 const Function *Callee = CS.getCalledFunction();
308 // indirect to a direct call by resolving a function pointer. If this
313 if (Function *F = CallSite(NewCall).getCalledFunction()) {
331 const Function *CalledFunc,
336 // If the called function is readonly, then it could not mutate the caller's
370 Function *Caller = TheCall->getParent()->getParent();
376 Function *MemCpyFn = Intrinsic::getDeclaration(Caller->getParent(),
399 // Uses of the argument in the function should use our new alloca
439 /// updateInlinedAtInfo - Helper function used by fixupLineNumbers to
457 static void fixupLineNumbers(Function *Fn, Function::iterator FI,
480 /// InlineFunction - This function inlines the called function into the basic
488 /// function by one level.
493 "Instruction not in function!");
498 const Function *CalledFunc = CS.getCalledFunction();
499 if (CalledFunc == 0 || // Can't inline external function or indirect
500 CalledFunc->isDeclaration() || // call, or call to a vararg function!
513 Function *Caller = OrigBB->getParent();
526 // Get the personality function from the callee if it contains a landing pad.
528 for (Function::const_iterator I = CalledFunc->begin(), E = CalledFunc->end();
537 // Find the personality function used by the landing pads of the caller. If it
538 // exists, then check to see that it matches the personality function used in
541 for (Function::const_iterator I = Caller->begin(), E = Caller->end();
558 // Get an iterator to the last basic block in the function, which will have
559 // the new function inlined after it.
560 Function::iterator LastBlock = &Caller->back();
563 // function.
566 Function::iterator FirstNewBlock;
574 // Calculate the vector of arguments to pass into the function cloner, which
578 for (Function::const_arg_iterator I = CalledFunc->arg_begin(),
660 // function we just inlined.
667 // function then there's no need to add redundant, less accurate markers.
703 Function *StackSave = Intrinsic::getDeclaration(M, Intrinsic::stacksave);
704 Function *StackRestore=Intrinsic::getDeclaration(M,Intrinsic::stackrestore);
711 // inlined function.
723 for (Function::iterator BB = FirstNewBlock, E = Caller->end();
776 // We want to clone the entire callee function into the hole between the
800 // basic block of the inlined function.
808 // Now that the function is correct, make it a little bit nicer. In
809 // particular, move the basic blocks inserted from the end of the function
825 // Anything that used the result of the function call should now use the
836 "Ret value not consistent in function!");
879 // We should always be able to fold the entry block of the function into the