fix typo; NFC
[oota-llvm.git] / lib / Transforms / Utils / SimplifyCFG.cpp
index 534c738f832d9945fb7df07ac2917a501adf51b9..a7f08352870918fb5d79e01e324ba0cab101ceff 100644 (file)
@@ -2827,7 +2827,7 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, IRBuilder<> &Builder,
   Values.erase(std::unique(Values.begin(), Values.end()), Values.end());
 
   // If Extra was used, we require at least two switch values to do the
-  // transformation.  A switch with one value is just an cond branch.
+  // transformation.  A switch with one value is just a conditional branch.
   if (ExtraCase && Values.size() < 2) return false;
 
   // TODO: Preserve branch weight metadata, similarly to how
@@ -2990,7 +2990,7 @@ bool SimplifyCFGOpt::SimplifyCleanupReturn(CleanupReturnInst *RI) {
          I != IE; ++I) {
       PHINode *DestPN = cast<PHINode>(I);
  
-      unsigned Idx = DestPN->getBasicBlockIndex(BB);
+      int Idx = DestPN->getBasicBlockIndex(BB);
       // Since BB unwinds to UnwindDest, it has to be in the PHI node.
       assert(Idx != -1);
       // This PHI node has an incoming value that corresponds to a control
@@ -3092,8 +3092,6 @@ bool SimplifyCFGOpt::SimplifyCleanupReturn(CleanupReturnInst *RI) {
           NewTPI->takeName(TPI);
           NewTPI->setDebugLoc(TPI->getDebugLoc());
           TPI->eraseFromParent();
-        } else if (auto *CPI = dyn_cast<CatchPadInst>(TI)) {
-          llvm_unreachable("A catchpad may not unwind to a cleanuppad.");
         } else {
           llvm_unreachable("Unexpected predecessor to cleanup pad.");
         }
@@ -3111,8 +3109,6 @@ bool SimplifyCFGOpt::SimplifyCleanupReturn(CleanupReturnInst *RI) {
         CEP->setUnwindDest(UnwindDest);
       else if (auto *TPI = dyn_cast<TerminatePadInst>(TI))
         TPI->setUnwindDest(UnwindDest);
-      else if (auto *CPI = dyn_cast<CatchPadInst>(TI))
-        llvm_unreachable("A catchpad may not unwind to a cleanuppad.");
       else
         llvm_unreachable("Unexpected predecessor to cleanup pad.");
     }