mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -592,7 +592,11 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
|
||||
}
|
||||
} else if (TBB && !FBB && Cond.empty()) {
|
||||
// Block unconditionally branches somewhere.
|
||||
if (MBB->succ_size() != 1+LandingPadSuccs.size()) {
|
||||
// If the block has exactly one successor, that happens to be a
|
||||
// landingpad, accept it as valid control flow.
|
||||
if (MBB->succ_size() != 1+LandingPadSuccs.size() &&
|
||||
(MBB->succ_size() != 1 || LandingPadSuccs.size() != 1 ||
|
||||
*MBB->succ_begin() != *LandingPadSuccs.begin())) {
|
||||
report("MBB exits via unconditional branch but doesn't have "
|
||||
"exactly one CFG successor!", MBB);
|
||||
} else if (!MBB->isSuccessor(TBB)) {
|
||||
|
||||
Reference in New Issue
Block a user