- // The Normal BU pass will have taken care of direct calls well already,
- // don't worry about them.
-
- // FIXME: if a direct callee had indirect callees, it seems like they could
- // be updated and we would have to reinline even direct calls!
-
- if (!CS.getCallSite().getCalledFunction()) {
- // Loop over all of the actually called functions...
- ActualCalleesTy::iterator I, E;
- tie(I, E) = ActualCallees.equal_range(TheCall);
- unsigned TNum = 0, Num = std::distance(I, E);
- for (; I != E; ++I, ++TNum) {
- Function *CalleeFunc = I->second;
- if (!CalleeFunc->isExternal()) {
- // Merge the callee's graph into this graph. This works for normal
- // calls or for self recursion within an SCC.
- DSGraph &GI = getOrCreateGraph(*CalleeFunc);
- ++NumCBUInlines;
- G.mergeInGraph(CS, *CalleeFunc, GI, DSGraph::KeepModRefBits |
- DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes |
- DSGraph::DontCloneAuxCallNodes);
- DEBUG(std::cerr << " Inlining graph [" << i << "/" << e-1
- << ":" << TNum << "/" << Num-1 << "] for "
- << CalleeFunc->getName() << "["
- << GI.getGraphSize() << "+" << GI.getAuxFunctionCalls().size()
- << "] into '" /*<< G.getFunctionNames()*/ << "' ["
- << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
- << "]\n");
- }
+ // Loop over all of the potentially called functions...
+ // Inline direct calls as well as indirect calls because the direct
+ // callee may have indirect callees and so may have changed.
+ //
+ ActualCalleesTy::iterator I, E;
+ tie(I, E) = ActualCallees.equal_range(TheCall);
+ unsigned TNum = 0, Num = std::distance(I, E);
+ for (; I != E; ++I, ++TNum) {
+ Function *CalleeFunc = I->second;
+ if (!CalleeFunc->isExternal()) {
+ // Merge the callee's graph into this graph. This works for normal
+ // calls or for self recursion within an SCC.
+ DSGraph &GI = getOrCreateGraph(*CalleeFunc);
+ ++NumCBUInlines;
+ G.mergeInGraph(CS, *CalleeFunc, GI, DSGraph::KeepModRefBits |
+ DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes |
+ DSGraph::DontCloneAuxCallNodes);
+ DEBUG(std::cerr << " Inlining graph [" << i << "/" << e-1
+ << ":" << TNum << "/" << Num-1 << "] for "
+ << CalleeFunc->getName() << "["
+ << GI.getGraphSize() << "+" << GI.getAuxFunctionCalls().size()
+ << "] into '" /*<< G.getFunctionNames()*/ << "' ["
+ << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
+ << "]\n");