Check the terminator, not the basic block.

llvm-svn: 140176
This commit is contained in:
Bill Wendling 2011-09-20 20:20:50 +00:00
parent 02e25db543
commit 3d48f59231
1 changed files with 2 additions and 1 deletions

View File

@ -278,7 +278,8 @@ bool BlockExtractorPass::runOnModule(Module &M) {
for (unsigned i = 0, e = BlocksToExtract.size(); i != e; ++i) {
SmallVector<BasicBlock*, 2> BlocksToExtractVec;
BlocksToExtractVec.push_back(BlocksToExtract[i]);
if (const InvokeInst *II = dyn_cast<InvokeInst>(BlocksToExtract[i]))
if (const InvokeInst *II =
dyn_cast<InvokeInst>(BlocksToExtract[i]->getTerminator()))
BlocksToExtractVec.push_back(II->getUnwindDest());
ExtractBasicBlock(BlocksToExtractVec);
}