From cf5933a716e7eb6bd5ff49aa62f3e76379ebaf51 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Jun 2004 04:11:48 +0000 Subject: [PATCH] Fix the inliner to be deterministic, not letting its output depend on the relative location of Function objects in memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14260 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/Inliner.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 0abc4f7179f..8fca96812b0 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -1,4 +1,4 @@ -//===- InlineCommon.cpp - Code common to all inliners ---------------------===// +//===- Inliner.cpp - Code common to all inliners --------------------------===// // // The LLVM Compiler Infrastructure // @@ -90,9 +90,8 @@ bool Inliner::runOnSCC(const std::vector &SCC) { // from inlining other functions. std::vector CallSites; - for (std::set::iterator SCCI = SCCFunctions.begin(), - E = SCCFunctions.end(); SCCI != E; ++SCCI) - if (Function *F = *SCCI) + for (unsigned i = 0, e = SCC.size(); i != e; ++i) + if (Function *F = SCC[i]->getFunction()) for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { CallSite CS = CallSite::get(I);