[MachineVerifier] Accept a MBB with a single landing pad successor.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 1 Dec 2014 18:43:53 +0000 (18:43 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 1 Dec 2014 18:43:53 +0000 (18:43 +0000)
commitfb6eeb74c58a38309d71816ffea1c1ac70e25fa3
treed965a44c61189f94c07c31a248aa9d20c0c5ae0a
parentdd42b533e96a267845ccb0911e337896a0dc204f
[MachineVerifier] Accept a MBB with a single landing pad successor.

The MachineVerifier used to check that there was always exactly one
unconditional branch to a non-landingpad (normal) successor.
If that normal successor to an invoke BB is unreachable, it seems
reasonable to only have one successor, the landing pad.
On targets other than AArch64 (and on AArch64 with a different testcase),
the branch folder turns the branch to the landing pad into a fallthrough.
The MachineVerifier, which relies on AnalyzeBranch, is unable to check
the condition, and doesn't complain. However, it does in this specific
testcase, where the branch to the landing pad remained.
Make the MachineVerifier accept it.

llvm-svn: 223059
llvm/lib/CodeGen/MachineVerifier.cpp
llvm/test/CodeGen/AArch64/br-to-eh-lpad.ll [new file with mode: 0644]