[llvm-commits] [llvm] r136341 - /llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp

Bill Wendling isanbard at gmail.com
Thu Jul 28 00:44:08 PDT 2011


Author: void
Date: Thu Jul 28 02:44:07 2011
New Revision: 136341

URL: http://llvm.org/viewvc/llvm-project?rev=136341&view=rev
Log:
Some minor cleanups. No functionalitical change.

Modified:
    llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=136341&r1=136340&r2=136341&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Thu Jul 28 02:44:07 2011
@@ -251,11 +251,10 @@
     SmallVector<Value*, 8> UnwindDestPHIValues;
 
     // New EH:
-    BasicBlock *OuterResumeDest;
-    BasicBlock *InnerResumeDest;
-    LandingPadInst *CallerLPad;
-    PHINode *InnerEHValuesPHI;
-    BasicBlock *SplitLPad;
+    BasicBlock *OuterResumeDest; //< Destination of the invoke's unwind.
+    BasicBlock *InnerResumeDest; //< Destination for the callee's resume.
+    LandingPadInst *CallerLPad;  //< LandingPadInst associated with the invoke.
+    PHINode *InnerEHValuesPHI;   //< PHI for EH values from landingpad insts.
 
   public:
     InvokeInliningInfo(InvokeInst *II)
@@ -263,10 +262,10 @@
         InnerUnwindDest(0), InnerExceptionPHI(0), InnerSelectorPHI(0),
 
         OuterResumeDest(II->getUnwindDest()), InnerResumeDest(0),
-        CallerLPad(0), InnerEHValuesPHI(0), SplitLPad(0) {
-      // If there are PHI nodes in the unwind destination block, we
-      // need to keep track of which values came into them from the
-      // invoke before removing the edge from this block.
+        CallerLPad(0), InnerEHValuesPHI(0) {
+      // If there are PHI nodes in the unwind destination block, we need to keep
+      // track of which values came into them from the invoke before removing
+      // the edge from this block.
       llvm::BasicBlock *InvokeBB = II->getParent();
       BasicBlock::iterator I = OuterUnwindDest->begin();
       for (; isa<PHINode>(I); ++I) {
@@ -276,8 +275,9 @@
       }
 
       // FIXME: With the new EH, this if/dyn_cast should be a 'cast'.
-      if (LandingPadInst *LPI = dyn_cast<LandingPadInst>(I))
+      if (LandingPadInst *LPI = dyn_cast<LandingPadInst>(I)) {
         CallerLPad = LPI;
+      }
     }
 
     /// The outer unwind destination is the target of unwind edges
@@ -296,13 +296,6 @@
     BasicBlock *getInnerUnwindDest_new();
 
     LandingPadInst *getLandingPadInst() const { return CallerLPad; }
-    BasicBlock *getSplitLandingPad() {
-      if (SplitLPad) return SplitLPad;
-      assert(CallerLPad && "Trying to split a block that isn't a landing pad!");
-      BasicBlock::iterator I = CallerLPad; ++I;
-      SplitLPad = CallerLPad->getParent()->splitBasicBlock(I, "split.lpad");
-      return SplitLPad;
-    }
 
     bool forwardEHResume(CallInst *call, BasicBlock *src);
 





More information about the llvm-commits mailing list