Lines Matching refs:Function
82 bool OptimizeEmptyGlobalCXXDtors(Function *CXAAtExitFn);
133 /// null/false. When the first accessing function is noticed, it is recorded.
134 /// When a second different accessing function is noticed,
136 const Function *AccessingFunction;
190 const Function *F = I->getParent()->getParent();
842 /// OptimizeGlobalAddressOfMalloc - This function takes the specified global
1364 // end of the function as they are unlikely to be executed.
1479 /// TryToOptimizeStoreOfMallocToGlobal - This function is called when we see a
1742 // If this is a first class global and has only one accessing function
1743 // and this function is main (which we know is not recursive we can make
1745 // in this function.
1856 /// function, changing them to FastCC.
1857 static void ChangeCalleesToFastCall(Function *F) {
1876 static void RemoveNestAttribute(Function *F) {
1888 Function *F = FI++;
1900 // If this function has C calling conventions, is not a varargs
1901 // function, and is only called directly, promote it to use the Fast
1911 // The function is not used by a trampoline intrinsic, so it is safe
1965 // Must have a function or null ptr.
1966 if (!isa<Function>(CS->getOperand(1)))
1980 static std::vector<Function*> ParseGlobalCtors(GlobalVariable *GV) {
1982 return std::vector<Function*>();
1984 std::vector<Function*> Result;
1988 Result.push_back(dyn_cast<Function>(CS->getOperand(1)));
1996 const std::vector<Function*> &Ctors) {
2072 /// This function should be called if C was not found (but just got inserted)
2298 /// EvaluateFunction - Evaluate a call to function F, returning true if
2300 /// arguments for the function.
2301 static bool EvaluateFunction(Function *F, Constant *&RetVal,
2303 std::vector<Function*> &CallStack,
2308 // Check to see if this function is already executing (recursion). If so,
2320 for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E;
2451 // Resolve function pointers.
2452 Function *Callee = dyn_cast<Function>(getVal(Values,
2463 // If this is a function we can constant fold, do it.
2515 // executed the new block before. If so, we have a looping function,
2548 /// EvaluateStaticConstructor - Evaluate static constructors in the function, if
2550 static bool EvaluateStaticConstructor(Function *F, const TargetData *TD) {
2564 std::vector<Function*> CallStack;
2570 // Call the function.
2579 DEBUG(dbgs() << "FULLY EVALUATED GLOBAL CTOR FUNCTION '"
2609 std::vector<Function*> Ctors = ParseGlobalCtors(GCL);
2616 Function *F = Ctors[i];
2703 static Function *FindCXAAtExit(Module &M) {
2704 Function *Fn = M.getFunction("__cxa_atexit");
2711 // Checking that the function has the right return type, the right number of
2723 /// cxxDtorIsEmpty - Returns whether the given function is an empty C++
2726 /// the code so we only look for a function with a single basic block, where
2728 static bool cxxDtorIsEmpty(const Function &Fn,
2729 SmallPtrSet<const Function *, 8> &CalledFunctions) {
2746 const Function *CalledFn = CI->getCalledFunction();
2751 SmallPtrSet<const Function *, 8> NewCalledFunctions(CalledFunctions);
2768 bool GlobalOpt::OptimizeEmptyGlobalCXXDtors(Function *CXAAtExitFn) {
2772 /// destruction on exit, a termination function is registered as follows:
2781 // This pass will look for calls to __cxa_atexit where the function is trivial
2785 for (Function::use_iterator I = CXAAtExitFn->use_begin(),
2794 Function *DtorFn =
2795 dyn_cast<Function>(CI->getArgOperand(0)->stripPointerCasts());
2799 SmallPtrSet<const Function *, 8> CalledFunctions;
2821 Function *CXAAtExitFn = FindCXAAtExit(M);