mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Fix bug: LowerSwitch/2003-08-23-EmptySwitch.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8087 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d34adad67
commit
44bb541c01
@ -63,6 +63,13 @@ void LowerSwitch::processSwitchInst(SwitchInst *SI) {
|
||||
// Unlink the switch instruction from it's block.
|
||||
CurBlock->getInstList().remove(SI);
|
||||
|
||||
// If there is only the default destination, don't bother with the code below.
|
||||
if (SI->getNumOperands() == 2) {
|
||||
CurBlock->getInstList().push_back(new BranchInst(SI->getDefaultDest()));
|
||||
delete SI;
|
||||
return;
|
||||
}
|
||||
|
||||
// Expand comparisons for all of the non-default cases...
|
||||
for (unsigned i = 2, e = SI->getNumOperands(); i != e; i += 2) {
|
||||
// Insert a new basic block after the current one...
|
||||
|
Loading…
x
Reference in New Issue
Block a user