Introduce a bit of a hack.
authorBill Wendling <isanbard@gmail.com>
Mon, 12 Sep 2011 21:56:59 +0000 (21:56 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 12 Sep 2011 21:56:59 +0000 (21:56 +0000)
commit3669915c6dc8d57a4525fb0c592e6c8c1df098f5
treec0dfa366f7be9c04453694409e398a8bfc828480
parentccb7c906d1a2237c6dca4f4e8fbc4d7dca89979a
Introduce a bit of a hack.

Splitting a landing pad takes considerable care because of PHIs and other
nasties. The problem is that the jump table needs to jump to the landing pad
block. However, the landing pad block can be jumped to only by an invoke
instruction. So we clone the landingpad instruction into its own basic block,
have the invoke jump to there. The landingpad instruction's basic block's
successor is now the target for the jump table.

But because of PHI nodes, we need to create another basic block for the jump
table to jump to. This is definitely a hack, because the values for the PHI
nodes may not be defined on the edge from the jump table. But that's okay,
because the jump table is simply a construct to mimic what is happening in the
CFG. So the values are mysteriously there, even though there is no value for the
PHI from the jump table's edge (hence calling this a hack).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139545 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SjLjEHPrepare.cpp