diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-14 08:12:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-14 08:12:40 +0000 |
commit | d5e8d9f29a11db395fe5bd464d9396bf2d8212fd (patch) | |
tree | 2617d3840b880359b016a29d29d2ff3dffdec737 /llvm/lib/Target/X86 | |
parent | c26f44fb0778fd24d8e4986a9b946bda0f53547b (diff) | |
download | bcm5719-llvm-d5e8d9f29a11db395fe5bd464d9396bf2d8212fd.tar.gz bcm5719-llvm-d5e8d9f29a11db395fe5bd464d9396bf2d8212fd.zip |
Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.
llvm-svn: 98482
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 40 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.h | 2 |
2 files changed, 19 insertions, 23 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 3c0607b2551..f1574cb23ae 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -797,7 +797,7 @@ static int mergeSPUpdates(MachineBasicBlock &MBB, } void X86RegisterInfo::emitCalleeSavedFrameMoves(MachineFunction &MF, - unsigned LabelId, + MCSymbol *Label, unsigned FramePtr) const { MachineFrameInfo *MFI = MF.getFrameInfo(); MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); @@ -860,7 +860,7 @@ void X86RegisterInfo::emitCalleeSavedFrameMoves(MachineFunction &MF, MachineLocation CSDst(MachineLocation::VirtualFP, Offset); MachineLocation CSSrc(Reg); - Moves.push_back(MachineMove(LabelId, CSDst, CSSrc)); + Moves.push_back(MachineMove(Label, CSDst, CSSrc)); } } @@ -959,26 +959,25 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { if (needsFrameMoves) { // Mark the place where EBP/RBP was saved. - unsigned FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(FrameLabel); // Define the current CFA rule to use the provided offset. if (StackSize) { MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, 2 * stackGrowth); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); } else { // FIXME: Verify & implement for FP MachineLocation SPDst(StackPtr); MachineLocation SPSrc(StackPtr, stackGrowth); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); } // Change the rule for the FramePtr to be an "offset" rule. MachineLocation FPDst(MachineLocation::VirtualFP, 2 * stackGrowth); MachineLocation FPSrc(FramePtr); - Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc)); + Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc)); } // Update EBP with the new base value... @@ -988,14 +987,13 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { if (needsFrameMoves) { // Mark effective beginning of when frame pointer becomes valid. - unsigned FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(FrameLabel); // Define the current CFA to use the EBP/RBP register. MachineLocation FPDst(FramePtr); MachineLocation FPSrc(MachineLocation::VirtualFP); - Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc)); + Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc)); } // Mark the FramePtr as live-in in every block except the entry. @@ -1029,16 +1027,15 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { if (!HasFP && needsFrameMoves) { // Mark callee-saved push instruction. - unsigned LabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)) - .addSym(MMI->getLabelSym(LabelId)); + MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(Label); // Define the current CFA rule to use the provided offset. unsigned Ptr = StackSize ? MachineLocation::VirtualFP : StackPtr; MachineLocation SPDst(Ptr); MachineLocation SPSrc(Ptr, StackOffset); - Moves.push_back(MachineMove(LabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(Label, SPDst, SPSrc)); StackOffset += stackGrowth; } } @@ -1102,9 +1099,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { if ((NumBytes || PushedRegs) && needsFrameMoves) { // Mark end of stack pointer adjustment. - unsigned LabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)) - .addSym(MMI->getLabelSym(LabelId)); + MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(Label); if (!HasFP && NumBytes) { // Define the current CFA rule to use the provided offset. @@ -1112,18 +1108,18 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, -StackSize + stackGrowth); - Moves.push_back(MachineMove(LabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(Label, SPDst, SPSrc)); } else { // FIXME: Verify & implement for FP MachineLocation SPDst(StackPtr); MachineLocation SPSrc(StackPtr, stackGrowth); - Moves.push_back(MachineMove(LabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(Label, SPDst, SPSrc)); } } // Emit DWARF info specifying the offsets of the callee-saved registers. if (PushedRegs) - emitCalleeSavedFrameMoves(MF, LabelId, HasFP ? FramePtr : StackPtr); + emitCalleeSavedFrameMoves(MF, Label, HasFP ? FramePtr : StackPtr); } } diff --git a/llvm/lib/Target/X86/X86RegisterInfo.h b/llvm/lib/Target/X86/X86RegisterInfo.h index 12b2f3ee3e5..ac96c4c8311 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.h +++ b/llvm/lib/Target/X86/X86RegisterInfo.h @@ -149,7 +149,7 @@ public: void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS = NULL) const; - void emitCalleeSavedFrameMoves(MachineFunction &MF, unsigned LabelId, + void emitCalleeSavedFrameMoves(MachineFunction &MF, MCSymbol *Label, unsigned FramePtr) const; void emitPrologue(MachineFunction &MF) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; |