diff --git a/include/llvm/CodeGen/MachineLocation.h b/include/llvm/CodeGen/MachineLocation.h index 2db4e5571ec..49344c5f98b 100644 --- a/include/llvm/CodeGen/MachineLocation.h +++ b/include/llvm/CodeGen/MachineLocation.h @@ -22,13 +22,13 @@ #define LLVM_CODEGEN_MACHINELOCATION_H namespace llvm { - + class MCSymbol; + class MachineLocation { private: bool IsRegister; // True if location is a register. unsigned Register; // gcc/gdb register number. int Offset; // Displacement if not register. - public: enum { // The target register number for an abstract frame pointer. The value is @@ -36,20 +36,11 @@ public: VirtualFP = ~0U }; MachineLocation() - : IsRegister(false) - , Register(0) - , Offset(0) - {} + : IsRegister(false), Register(0), Offset(0) {} explicit MachineLocation(unsigned R) - : IsRegister(true) - , Register(R) - , Offset(0) - {} + : IsRegister(true), Register(R), Offset(0) {} MachineLocation(unsigned R, int O) - : IsRegister(false) - , Register(R) - , Offset(O) - {} + : IsRegister(false), Register(R), Offset(O) {} // Accessors bool isReg() const { return IsRegister; } @@ -74,29 +65,24 @@ public: #endif }; +/// MachineMove - This class represents the save or restore of a callee saved +/// register that exception or debug info needs to know about. class MachineMove { private: - unsigned LabelID; // Label ID number for post-instruction - // address when result of move takes - // effect. - MachineLocation Destination; // Move to location. - MachineLocation Source; // Move from location. + /// Label - Symbol for post-instruction address when result of move takes + /// effect. + MCSymbol *Label; + // Move to & from location. + MachineLocation Destination, Source; public: - MachineMove() - : LabelID(0) - , Destination() - , Source() - {} + MachineMove() : Label(0) {} - MachineMove(unsigned ID, MachineLocation &D, MachineLocation &S) - : LabelID(ID) - , Destination(D) - , Source(S) - {} + MachineMove(MCSymbol *label, MachineLocation &D, MachineLocation &S) + : Label(label), Destination(D), Source(S) {} // Accessors - unsigned getLabelID() const { return LabelID; } + MCSymbol *getLabel() const { return Label; } const MachineLocation &getDestination() const { return Destination; } const MachineLocation &getSource() const { return Source; } }; diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index f79b2ab6f91..e21269604e2 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -247,13 +247,9 @@ void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel, for (unsigned i = 0, N = Moves.size(); i < N; ++i) { const MachineMove &Move = Moves[i]; - MCSymbol *Label = 0; - unsigned LabelID = Move.getLabelID(); + MCSymbol *Label = Move.getLabel(); // Throw out move if the label is invalid. - if (LabelID) { - Label = getDWLabel("label", LabelID); - if (!Label->isDefined()) continue; // Not emitted, in dead code. - } + if (Label && !Label->isDefined()) continue; // Not emitted, in dead code. const MachineLocation &Dst = Move.getDestination(); const MachineLocation &Src = Move.getSource(); diff --git a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp index ee1ec72cb0f..7baf053e99f 100644 --- a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp @@ -68,32 +68,29 @@ JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr, unsigned PointerSize = TD->getPointerSize(); int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ? PointerSize : -PointerSize; - bool IsLocal = false; - unsigned BaseLabelID = 0; + MCSymbol *BaseLabel = 0; for (unsigned i = 0, N = Moves.size(); i < N; ++i) { const MachineMove &Move = Moves[i]; - unsigned LabelID = Move.getLabelID(); - MCSymbol *Label = LabelID ? MMI->getLabelSym(LabelID) : 0; + MCSymbol *Label = Move.getLabel(); // Throw out move if the label is invalid. if (Label && !Label->isDefined()) continue; intptr_t LabelPtr = 0; - if (LabelID) LabelPtr = JCE->getLabelAddress(Label); + if (Label) LabelPtr = JCE->getLabelAddress(Label); const MachineLocation &Dst = Move.getDestination(); const MachineLocation &Src = Move.getSource(); // Advance row if new location. - if (BaseLabelPtr && LabelID && (BaseLabelID != LabelID || !IsLocal)) { + if (BaseLabelPtr && Label && BaseLabel != Label) { JCE->emitByte(dwarf::DW_CFA_advance_loc4); JCE->emitInt32(LabelPtr - BaseLabelPtr); - BaseLabelID = LabelID; + BaseLabel = Label; BaseLabelPtr = LabelPtr; - IsLocal = true; } // If advancing cfa. @@ -712,21 +709,20 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr, for (unsigned i = 0, N = Moves.size(); i < N; ++i) { const MachineMove &Move = Moves[i]; - unsigned LabelID = Move.getLabelID(); - MCSymbol *Label = LabelID ? MMI->getLabelSym(LabelID) : 0; + MCSymbol *Label = Move.getLabel(); // Throw out move if the label is invalid. if (Label && !Label->isDefined()) continue; intptr_t LabelPtr = 0; - if (LabelID) LabelPtr = JCE->getLabelAddress(Label); + if (Label) LabelPtr = JCE->getLabelAddress(Label); const MachineLocation &Dst = Move.getDestination(); const MachineLocation &Src = Move.getSource(); // Advance row if new location. - if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) { + if (BaseLabelPtr && Label && (BaseLabelPtr != LabelPtr || !IsLocal)) { FinalSize++; FinalSize += PointerSize; BaseLabelPtr = LabelPtr; diff --git a/lib/Target/CellSPU/SPURegisterInfo.cpp b/lib/Target/CellSPU/SPURegisterInfo.cpp index 915389c3313..daa39a8d36f 100644 --- a/lib/Target/CellSPU/SPURegisterInfo.cpp +++ b/lib/Target/CellSPU/SPURegisterInfo.cpp @@ -436,7 +436,7 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const // Prepare for debug frame info. bool hasDebugInfo = MMI && MMI->hasDebugInfo(); - unsigned FrameLabelId = 0; + MCSymbol *FrameLabel = 0; // Move MBBI back to the beginning of the function. MBBI = MBB.begin(); @@ -452,9 +452,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const FrameSize = -(FrameSize + SPUFrameInfo::minStackSize()); if (hasDebugInfo) { // Mark effective beginning of when frame pointer becomes valid. - FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addSym(FrameLabel); } // Adjust stack pointer, spilling $lr -> 16($sp) and $sp -> -FrameSize($sp) @@ -501,7 +500,7 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const // Show update of SP. MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); // Add callee saved registers to move list. const std::vector &CSI = MFI->getCalleeSavedInfo(); @@ -511,17 +510,16 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const if (Reg == SPU::R0) continue; MachineLocation CSDst(MachineLocation::VirtualFP, Offset); MachineLocation CSSrc(Reg); - Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); + Moves.push_back(MachineMove(FrameLabel, CSDst, CSSrc)); } // Mark effective beginning of when frame pointer is ready. - unsigned ReadyLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)) - .addSym(MMI->getLabelSym(ReadyLabelId)); + MCSymbol *ReadyLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addSym(ReadyLabel); MachineLocation FPDst(SPU::R1); MachineLocation FPSrc(MachineLocation::VirtualFP); - Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); + Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc)); } } else { // This is a leaf function -- insert a branch hint iff there are diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 64e4e200ee9..744f6c6b86d 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -1287,7 +1287,7 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { UnwindTablesMandatory; // Prepare for frame info. - unsigned FrameLabelId = 0; + MCSymbol *FrameLabel = 0; // Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it, // process it. @@ -1446,34 +1446,33 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { // reverse order. if (needsFrameMoves) { // Mark effective beginning of when frame pointer becomes valid. - FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addSym(FrameLabel); // Show update of SP. if (NegFrameSize) { MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); } else { MachineLocation SP(isPPC64 ? PPC::X31 : PPC::R31); - Moves.push_back(MachineMove(FrameLabelId, SP, SP)); + Moves.push_back(MachineMove(FrameLabel, SP, SP)); } if (HasFP) { MachineLocation FPDst(MachineLocation::VirtualFP, FPOffset); MachineLocation FPSrc(isPPC64 ? PPC::X31 : PPC::R31); - Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc)); + Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc)); } if (MustSaveLR) { MachineLocation LRDst(MachineLocation::VirtualFP, LROffset); MachineLocation LRSrc(isPPC64 ? PPC::LR8 : PPC::LR); - Moves.push_back(MachineMove(FrameLabelId, LRDst, LRSrc)); + Moves.push_back(MachineMove(FrameLabel, LRDst, LRSrc)); } } - unsigned ReadyLabelId = 0; + MCSymbol *ReadyLabel = 0; // If there is a frame pointer, copy R1 into R31 if (HasFP) { @@ -1488,21 +1487,20 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { } if (needsFrameMoves) { - ReadyLabelId = MMI->NextLabelID(); + ReadyLabel = MMI->getLabelSym(MMI->NextLabelID()); // Mark effective beginning of when frame pointer is ready. - BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)) - .addSym(MMI->getLabelSym(ReadyLabelId)); + BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addSym(ReadyLabel); MachineLocation FPDst(HasFP ? (isPPC64 ? PPC::X31 : PPC::R31) : (isPPC64 ? PPC::X1 : PPC::R1)); MachineLocation FPSrc(MachineLocation::VirtualFP); - Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); + Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc)); } } if (needsFrameMoves) { - unsigned LabelId = HasFP ? ReadyLabelId : FrameLabelId; + MCSymbol *Label = HasFP ? ReadyLabel : FrameLabel; // Add callee saved registers to move list. const std::vector &CSI = MFI->getCalleeSavedInfo(); @@ -1512,7 +1510,7 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { if (Reg == PPC::LR || Reg == PPC::LR8 || Reg == PPC::RM) continue; MachineLocation CSDst(MachineLocation::VirtualFP, Offset); MachineLocation CSSrc(Reg); - Moves.push_back(MachineMove(LabelId, CSDst, CSSrc)); + Moves.push_back(MachineMove(Label, CSDst, CSSrc)); } } } diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 3c0607b2551..f1574cb23ae 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/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/lib/Target/X86/X86RegisterInfo.h b/lib/Target/X86/X86RegisterInfo.h index 12b2f3ee3e5..ac96c4c8311 100644 --- a/lib/Target/X86/X86RegisterInfo.h +++ b/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; diff --git a/lib/Target/XCore/XCoreInstrInfo.cpp b/lib/Target/XCore/XCoreInstrInfo.cpp index 801116e4e8e..1c3e33fb701 100644 --- a/lib/Target/XCore/XCoreInstrInfo.cpp +++ b/lib/Target/XCore/XCoreInstrInfo.cpp @@ -429,11 +429,9 @@ bool XCoreInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, storeRegToStackSlot(MBB, MI, it->getReg(), true, it->getFrameIdx(), it->getRegClass()); if (emitFrameMoves) { - unsigned SaveLabelId = MMI->NextLabelID(); - BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL)) - .addSym(MMI->getLabelSym(SaveLabelId)); - XFI->getSpillLabels().push_back( - std::pair(SaveLabelId, *it)); + MCSymbol *SaveLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL)).addSym(SaveLabel); + XFI->getSpillLabels().push_back(std::make_pair(SaveLabel, *it)); } } return true; diff --git a/lib/Target/XCore/XCoreMachineFunctionInfo.h b/lib/Target/XCore/XCoreMachineFunctionInfo.h index 124a011f3cb..a575a0f6954 100644 --- a/lib/Target/XCore/XCoreMachineFunctionInfo.h +++ b/lib/Target/XCore/XCoreMachineFunctionInfo.h @@ -31,7 +31,7 @@ private: int LRSpillSlot; int FPSpillSlot; int VarArgsFrameIndex; - std::vector > SpillLabels; + std::vector > SpillLabels; public: XCoreFunctionInfo() : @@ -60,7 +60,7 @@ public: void setFPSpillSlot(int off) { FPSpillSlot = off; } int getFPSpillSlot() const { return FPSpillSlot; } - std::vector >&getSpillLabels() { + std::vector > &getSpillLabels() { return SpillLabels; } }; diff --git a/lib/Target/XCore/XCoreRegisterInfo.cpp b/lib/Target/XCore/XCoreRegisterInfo.cpp index 6a00afaa4b0..856ae36ed39 100644 --- a/lib/Target/XCore/XCoreRegisterInfo.cpp +++ b/lib/Target/XCore/XCoreRegisterInfo.cpp @@ -456,18 +456,17 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const { std::vector &Moves = MMI->getFrameMoves(); // Show update of SP. - unsigned FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(FrameLabel); MachineLocation SPDst(MachineLocation::VirtualFP); MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize * 4); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc)); if (LRSavedOnEntry) { MachineLocation CSDst(MachineLocation::VirtualFP, 0); MachineLocation CSSrc(XCore::LR); - Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); + Moves.push_back(MachineMove(FrameLabel, CSDst, CSSrc)); } } if (saveLR) { @@ -476,13 +475,11 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const { MBB.addLiveIn(XCore::LR); if (emitFrameMoves) { - unsigned SaveLRLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)) - .addSym(MMI->getLabelSym(SaveLRLabelId)); + MCSymbol *SaveLRLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(SaveLRLabel); MachineLocation CSDst(MachineLocation::VirtualFP, LRSpillOffset); MachineLocation CSSrc(XCore::LR); - MMI->getFrameMoves().push_back(MachineMove(SaveLRLabelId, - CSDst, CSSrc)); + MMI->getFrameMoves().push_back(MachineMove(SaveLRLabel, CSDst, CSSrc)); } } } @@ -494,13 +491,11 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const { // R10 is live-in. It is killed at the spill. MBB.addLiveIn(XCore::R10); if (emitFrameMoves) { - unsigned SaveR10LabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)) - .addSym(MMI->getLabelSym(SaveR10LabelId)); + MCSymbol *SaveR10Label = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(SaveR10Label); MachineLocation CSDst(MachineLocation::VirtualFP, FPSpillOffset); MachineLocation CSSrc(XCore::R10); - MMI->getFrameMoves().push_back(MachineMove(SaveR10LabelId, - CSDst, CSSrc)); + MMI->getFrameMoves().push_back(MachineMove(SaveR10Label, CSDst, CSSrc)); } // Set the FP from the SP. unsigned FramePtr = XCore::R10; @@ -508,22 +503,21 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const { .addImm(0); if (emitFrameMoves) { // Show FP is now valid. - unsigned FrameLabelId = MMI->NextLabelID(); - BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)) - .addSym(MMI->getLabelSym(FrameLabelId)); + MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID()); + BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(FrameLabel); MachineLocation SPDst(FramePtr); MachineLocation SPSrc(MachineLocation::VirtualFP); - MMI->getFrameMoves().push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + MMI->getFrameMoves().push_back(MachineMove(FrameLabel, SPDst, SPSrc)); } } if (emitFrameMoves) { // Frame moves for callee saved. std::vector &Moves = MMI->getFrameMoves(); - std::vector >&SpillLabels = + std::vector >&SpillLabels = XFI->getSpillLabels(); for (unsigned I = 0, E = SpillLabels.size(); I != E; ++I) { - unsigned SpillLabel = SpillLabels[I].first; + MCSymbol *SpillLabel = SpillLabels[I].first; CalleeSavedInfo &CSI = SpillLabels[I].second; int Offset = MFI->getObjectOffset(CSI.getFrameIdx()); unsigned Reg = CSI.getReg();