forked from OSchip/llvm-project
Fix a bug which occurred with empty basic blocks
llvm-svn: 5982
This commit is contained in:
parent
e22031edfe
commit
f22d1f5912
|
@ -160,7 +160,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
|
||||||
const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
|
const TargetInstrInfo &TII = Fn.getTarget().getInstrInfo();
|
||||||
for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
|
for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) {
|
||||||
// If last instruction is a return instruction, add an epilogue
|
// 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;
|
MBB = FI; I = MBB->end()-1;
|
||||||
|
|
||||||
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
|
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue