Sink landing-pad marking code out of
authorDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 16:32:56 +0000 (16:32 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 16:32:56 +0000 (16:32 +0000)
SelectionDAGISel::runOnMachineFunction into FunctionLowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101252 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 04c27e7c15f8d4fa696dcc817d3168dd183054ab..d7ed46a08adf18de0cb2d74c46178b1e52804513 100644 (file)
@@ -232,6 +232,11 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf,
       }
     }
   }
+
+  // Mark landing pad blocks.
+  for (BB = Fn->begin(); BB != EB; ++BB)
+    if (InvokeInst *Invoke = dyn_cast<InvokeInst>(BB->getTerminator()))
+      MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
 }
 
 /// clear - Clear out all the function-specific state. This returns this
index c7cc695d6be28aacd0c4ee4567b644e4f90d56e4..6067b1fded3796db78714e26563970b7ca64fa6b 100644 (file)
@@ -332,11 +332,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
   FuncInfo->set(Fn, *MF, EnableFastISel);
   SDB->init(GFI, *AA);
 
-  for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
-    if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator()))
-      // Mark landing pad.
-      FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
-
   SelectAllBasicBlocks(Fn, *MF, TII);
 
   // If the first basic block in the function has live ins that need to be