Disable the inlining of non-direct recursions (where A->B->A).

Swift SVN r17101
This commit is contained in:
Nadav Rotem
2014-04-30 18:45:13 +00:00
parent 47628dbfb6
commit e406e43060
8 changed files with 142 additions and 15 deletions

View File

@@ -41,11 +41,18 @@ void CompleteFunctions::setComplete() {
const std::vector<SILFunction*> &CallGraphAnalysis::bottomUpCallGraphOrder() {
// If we haven't calculated the order before do it now.
if (!BottomUpFunctionOrder.size())
swift::bottomUpCallGraphOrder(M, BottomUpFunctionOrder);
swift::bottomUpCallGraphOrder(M, BottomUpFunctionOrder, RecursiveCallers);
return BottomUpFunctionOrder;
}
const llvm::DenseSet<SILFunction*> &CallGraphAnalysis::recursiveCallers() {
// Calculate the call-graph.
bottomUpCallGraphOrder();
return RecursiveCallers;
}
SILAnalysis *swift::createCallGraphAnalysis(SILModule *M) {
return new CallGraphAnalysis(M);
}