diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-11 02:38:11 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-11 02:38:11 +0000 |
commit | d84ccfaf50c7843f31ffc74a8a8e33f779453d6e (patch) | |
tree | f4b6d66d0073522dffc3f98066814aba0e76edc8 /lib/Target/PowerPC/PPCFrameLowering.cpp | |
parent | baf81af7591dedb2587bf8e439e07a97dbe454f9 (diff) | |
download | external_llvm-d84ccfaf50c7843f31ffc74a8a8e33f779453d6e.zip external_llvm-d84ccfaf50c7843f31ffc74a8a8e33f779453d6e.tar.gz external_llvm-d84ccfaf50c7843f31ffc74a8a8e33f779453d6e.tar.bz2 |
Change getFrameMoves to return a const reference.
To add a frame now there is a dedicated addFrameMove which also takes
care of constructing the move itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCFrameLowering.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCFrameLowering.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Target/PowerPC/PPCFrameLowering.cpp b/lib/Target/PowerPC/PPCFrameLowering.cpp index 9ec10f6..cd70aee 100644 --- a/lib/Target/PowerPC/PPCFrameLowering.cpp +++ b/lib/Target/PowerPC/PPCFrameLowering.cpp @@ -515,8 +515,6 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const { } } - std::vector<MachineMove> &Moves = MMI.getFrameMoves(); - // Add the "machine moves" for the instructions we generated above, but in // reverse order. if (needsFrameMoves) { @@ -528,22 +526,22 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const { if (NegFrameSize) { MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize); - Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); + MMI.addFrameMove(FrameLabel, SPDst, SPSrc); } else { MachineLocation SP(isPPC64 ? PPC::X31 : PPC::R31); - Moves.push_back(MachineMove(FrameLabel, SP, SP)); + MMI.addFrameMove(FrameLabel, SP, SP); } if (HasFP) { MachineLocation FPDst(MachineLocation::VirtualFP, FPOffset); MachineLocation FPSrc(isPPC64 ? PPC::X31 : PPC::R31); - Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc)); + MMI.addFrameMove(FrameLabel, FPDst, FPSrc); } if (MustSaveLR) { MachineLocation LRDst(MachineLocation::VirtualFP, LROffset); MachineLocation LRSrc(isPPC64 ? PPC::LR8 : PPC::LR); - Moves.push_back(MachineMove(FrameLabel, LRDst, LRSrc)); + MMI.addFrameMove(FrameLabel, LRDst, LRSrc); } } @@ -570,7 +568,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const { MachineLocation FPDst(HasFP ? (isPPC64 ? PPC::X31 : PPC::R31) : (isPPC64 ? PPC::X1 : PPC::R1)); MachineLocation FPSrc(MachineLocation::VirtualFP); - Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc)); + MMI.addFrameMove(ReadyLabel, FPDst, FPSrc); } } @@ -602,14 +600,14 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const { && (PPC::CR2 <= Reg && Reg <= PPC::CR4)) { MachineLocation CSDst(PPC::X1, 8); MachineLocation CSSrc(PPC::CR2); - Moves.push_back(MachineMove(Label, CSDst, CSSrc)); + MMI.addFrameMove(Label, CSDst, CSSrc); continue; } int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); MachineLocation CSDst(MachineLocation::VirtualFP, Offset); MachineLocation CSSrc(Reg); - Moves.push_back(MachineMove(Label, CSDst, CSSrc)); + MMI.addFrameMove(Label, CSDst, CSSrc); } } } |