[WinEH] Fold cast into assertion based on review feedback
authorReid Kleckner <reid@kleckner.net>
Fri, 3 Apr 2015 18:18:06 +0000 (18:18 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 3 Apr 2015 18:18:06 +0000 (18:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234034 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/WinEHPrepare.cpp

index b16da712cc9e48f21182b2791b97731d410e0839..c6caff3eadbd6e2ab8fff08e98554f803768ec37 100644 (file)
@@ -882,9 +882,8 @@ CloningDirector::CloningAction WinEHCatchDirector::handleBeginCatch(
   ExceptionObjectVar = Inst->getOperand(1)->stripPointerCasts();
   if (isa<ConstantPointerNull>(ExceptionObjectVar))
     return CloningDirector::SkipInstruction;
-  AllocaInst *AI = dyn_cast<AllocaInst>(ExceptionObjectVar);
-  (void)AI;
-  assert(AI && AI->isStaticAlloca() && "catch parameter is not static alloca");
+  assert(cast<AllocaInst>(ExceptionObjectVar)->isStaticAlloca() &&
+         "catch parameter is not static alloca");
   Materializer.escapeCatchObject(ExceptionObjectVar);
   return CloningDirector::SkipInstruction;
 }