Fix the inliner to be deterministic, not letting its output depend on the
authorChris Lattner <sabre@nondot.org>
Sun, 20 Jun 2004 04:11:48 +0000 (04:11 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Jun 2004 04:11:48 +0000 (04:11 +0000)
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

index 0abc4f7179feeb9b3279e33650fef5ceded4cd5f..8fca96812b0870a57a1bcf0eb97d677d3410a78c 100644 (file)
@@ -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);