mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
Fix a bug which occurred with empty basic blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5982 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
590607b01c
commit
b589bf7d77
@ -160,7 +160,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
|
||||
const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
|
||||
for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
|
||||
// If last instruction is a return instruction, add an epilogue
|
||||
if (TII.isReturn(FI->back()->getOpcode())) {
|
||||
if (!FI->empty() && TII.isReturn(FI->back()->getOpcode())) {
|
||||
MBB = FI; I = MBB->end()-1;
|
||||
|
||||
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user