[WinEH] Fold cast into assertion based on review feedback

llvm-svn: 234034
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index b16da71..c6caff3 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -882,9 +882,8 @@
   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;
 }