projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
590607b
)
Fix a bug which occurred with empty basic blocks
author
Chris Lattner
<sabre@nondot.org>
Fri, 2 May 2003 18:44:42 +0000
(18:44 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Fri, 2 May 2003 18:44:42 +0000
(18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5982
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/PrologEpilogInserter.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/PrologEpilogInserter.cpp
b/lib/CodeGen/PrologEpilogInserter.cpp
index 2f7f1f4ef30a8e49a595edf2f7d77333828912e0..4839c09751dbfeae95d6a15ee9409ac34c8cace0 100644
(file)
--- a/
lib/CodeGen/PrologEpilogInserter.cpp
+++ b/
lib/CodeGen/PrologEpilogInserter.cpp
@@
-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) {