mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Adjust the MachineBasicBlock verifier rules to be more
tolerant of blocks that end with "unreachable". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f83a5def43
commit
a01a80fa6c
@ -312,14 +312,14 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB)
|
|||||||
if (MBB->empty()) {
|
if (MBB->empty()) {
|
||||||
report("MBB doesn't fall through but is empty!", MBB);
|
report("MBB doesn't fall through but is empty!", MBB);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// Block falls through.
|
if (TII->BlockHasNoFallThrough(*MBB)) {
|
||||||
if (!MBB->empty() && MBB->back().getDesc().isBarrier()) {
|
if (MBB->empty()) {
|
||||||
report("MBB falls through but ends with a barrier instruction!", MBB);
|
|
||||||
}
|
|
||||||
if (TII->BlockHasNoFallThrough(*MBB)) {
|
|
||||||
report("TargetInstrInfo says the block has no fall through, but the "
|
report("TargetInstrInfo says the block has no fall through, but the "
|
||||||
"CFG has a fall-through edge!", MBB);
|
"block is empty!", MBB);
|
||||||
|
} else if (!MBB->back().getDesc().isBarrier()) {
|
||||||
|
report("TargetInstrInfo says the block has no fall through, but the "
|
||||||
|
"block does not end in a barrier!", MBB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -341,10 +341,13 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB)
|
|||||||
MachineFunction::const_iterator MBBI = MBB;
|
MachineFunction::const_iterator MBBI = MBB;
|
||||||
++MBBI;
|
++MBBI;
|
||||||
if (MBBI == MF->end()) {
|
if (MBBI == MF->end()) {
|
||||||
// TODO: This condition is sometimes reached for functions which
|
// It's possible that the block legitimately ends with a noreturn
|
||||||
// make noreturn calls or contain unreachable. Should AnalyzeBranch
|
// call or an unreachable, in which case it won't actually fall
|
||||||
// be changed to handle such cases differently?
|
// out the bottom of the function.
|
||||||
report("MBB falls through out of function!", MBB);
|
} else if (MBB->succ_empty()) {
|
||||||
|
// It's possible that the block legitimately ends with a noreturn
|
||||||
|
// call or an unreachable, in which case it won't actuall fall
|
||||||
|
// out of the block.
|
||||||
} else if (MBB->succ_size() != 1) {
|
} else if (MBB->succ_size() != 1) {
|
||||||
report("MBB exits via unconditional fall-through but doesn't have "
|
report("MBB exits via unconditional fall-through but doesn't have "
|
||||||
"exactly one CFG successor!", MBB);
|
"exactly one CFG successor!", MBB);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user