aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-01-31 00:27:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-01-31 00:27:49 +0000
commit00dff8dda29b5a249cd99405ce26e84cef13ba53 (patch)
tree4d3609905d188632c4ca53e52f1cc6fd30bb60e5 /lib/CodeGen/PrologEpilogInserter.cpp
parentc6c391daddbafa722d9ca87d18f204e9a6e617a3 (diff)
downloadexternal_llvm-00dff8dda29b5a249cd99405ce26e84cef13ba53.zip
external_llvm-00dff8dda29b5a249cd99405ce26e84cef13ba53.tar.gz
external_llvm-00dff8dda29b5a249cd99405ce26e84cef13ba53.tar.bz2
Also avoid adding callee save code before debug labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 0280318..c990ba4 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -243,11 +243,19 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
return;
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
-
+
// Now that we have a stack slot for each register to be saved, insert spill
// code into the entry block.
MachineBasicBlock *MBB = Fn.begin();
MachineBasicBlock::iterator I = MBB->begin();
+
+ // Do not insert prologue code before debug LABELs at the start of the
+ // entry block.
+ MachineModuleInfo *MMI = FFI->getMachineModuleInfo();
+ if (MMI && MMI->hasDebugInfo())
+ while (I != MBB->end() && I->getOpcode() == TargetInstrInfo::LABEL)
+ ++I;
+
if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) {
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
// Add the callee-saved register as live-in. It's killed at the spill.