Handle the situation where CodeGenPrepare removes a reference to a BB that has
authorBill Wendling <isanbard@gmail.com>
Thu, 29 Nov 2012 19:38:06 +0000 (19:38 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 29 Nov 2012 19:38:06 +0000 (19:38 +0000)
commit73601160486b14711e1c6fdd86481eda9c319e45
treef9c492fa27866b3f7563509fc644faa1e7513651
parentb53b791efd85e9278baacb29745217dfa2eae775
Handle the situation where CodeGenPrepare removes a reference to a BB that has
the last invoke instruction in the function. This also removes the last landing
pad in an function. This is fine, but with SjLj EH code, we've already placed a
bunch of code in the 'entry' block, which expects the landing pad to stick
around.

When we get to the situation where CGP has removed the last landing pad, go
ahead and nuke the SjLj instructions from the 'entry' block.
<rdar://problem/12721258>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168930 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/CodeGenPrepare.cpp
test/CodeGen/ARM/crash.ll