diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-08-29 16:24:26 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-08-29 16:24:26 +0000 |
| commit | ce50a165c784d71abf1b2f981be18f867787d972 (patch) | |
| tree | 33d65f6e590c8fecf1aa457fd7181f6936d209c5 /lib/Target/PowerPC/PPCRegisterInfo.cpp | |
| parent | 85aaf9088e98451bb31c7942986f63e95dedef4d (diff) | |
Handle callee saved registers in dwarf frame info (lead up to exception
handling.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index d0a21e661a..bf50e3579e 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -668,15 +668,22 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { std::vector<MachineMove *> &Moves = DebugInfo->getFrameMoves(); unsigned LabelID = DebugInfo->NextLabelID(); - // Show update of SP. - MachineLocation Dst(MachineLocation::VirtualFP); - MachineLocation Src(MachineLocation::VirtualFP, NegNumbytes); - Moves.push_back(new MachineMove(LabelID, Dst, Src)); - // Mark effective beginning of when frame pointer becomes valid. BuildMI(MBB, MBBI, PPC::DWARF_LABEL, 1).addImm(LabelID); - + // Show update of SP. + MachineLocation SPDst(MachineLocation::VirtualFP); + MachineLocation SPSrc(MachineLocation::VirtualFP, NegNumbytes); + Moves.push_back(new MachineMove(LabelID, SPDst, SPSrc)); + + // Add callee saved registers to move list. + const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo(); + for (unsigned I = 0, E = CSI.size(); I != E; ++I) { + MachineLocation CSDst(MachineLocation::VirtualFP, + MFI->getObjectOffset(CSI[I].getFrameIdx())); + MachineLocation CSSrc(CSI[I].getReg()); + Moves.push_back(new MachineMove(LabelID, CSDst, CSSrc)); + } } // If there is a frame pointer, copy R1 (SP) into R31 (FP) |
