summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-20 04:11:48 +0000
committerChris Lattner <sabre@nondot.org>2004-06-20 04:11:48 +0000
commitcf5933a716e7eb6bd5ff49aa62f3e76379ebaf51 (patch)
tree4a29d051a5ffa76e47823fc3590c2ce3963fb2d5 /lib/Transforms/IPO/Inliner.cpp
parent8e6d2bb8fa3e4d62fa3e0623d84381fcc4dc4330 (diff)
downloadllvm-cf5933a716e7eb6bd5ff49aa62f3e76379ebaf51.tar.gz
llvm-cf5933a716e7eb6bd5ff49aa62f3e76379ebaf51.tar.bz2
llvm-cf5933a716e7eb6bd5ff49aa62f3e76379ebaf51.tar.xz
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
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 0abc4f7179..8fca96812b 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<CallGraphNode*> &SCC) {
// from inlining other functions.
std::vector<CallSite> CallSites;
- for (std::set<Function*>::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);