[WinEH] Fold cast into assertion based on review feedback

llvm-svn: 234034
This commit is contained in:
Reid Kleckner 2015-04-03 18:18:06 +00:00
parent 2738278b7f
commit aab30e1454
1 changed files with 2 additions and 3 deletions

View 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;
}