From 9580641d5facf436e549982a5b0a5b3b694f9dc0 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 28 Jul 2011 07:44:07 +0000 Subject: [PATCH] Some minor cleanups. No functionalitical change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136341 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/InlineFunction.cpp | 27 +++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 5cba7ee8238..484899f4178 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -251,11 +251,10 @@ namespace { SmallVector 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 @@ namespace { 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(I); ++I) { @@ -276,8 +275,9 @@ namespace { } // FIXME: With the new EH, this if/dyn_cast should be a 'cast'. - if (LandingPadInst *LPI = dyn_cast(I)) + if (LandingPadInst *LPI = dyn_cast(I)) { CallerLPad = LPI; + } } /// The outer unwind destination is the target of unwind edges @@ -296,13 +296,6 @@ namespace { 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);