1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix a bug which occurred with empty basic blocks

llvm-svn: 5982
This commit is contained in:
Chris Lattner 2003-05-02 18:44:42 +00:00
parent 08b4007a7c
commit 8f2c71cae2

View File

@ -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) {