mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
change the DBG_LABEL MachineInstr to always be created
with an MCSymbol instead of an immediate. llvm-svn: 98481
This commit is contained in:
parent
c90ed01cf3
commit
ba3b320aa3
@ -1553,13 +1553,7 @@ void AsmPrinter::printKill(const MachineInstr *MI) const {
|
||||
/// printLabel - This method prints a local label used by debug and
|
||||
/// exception handling tables.
|
||||
void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
|
||||
MCSymbol *Sym;
|
||||
|
||||
if (MI->getOperand(0).isMCSymbol())
|
||||
Sym = MI->getOperand(0).getMCSymbol();
|
||||
else
|
||||
Sym = MMI->getLabelSym(MI->getOperand(0).getImm());
|
||||
OutStreamer.EmitLabel(Sym);
|
||||
OutStreamer.EmitLabel(MI->getOperand(0).getMCSymbol());
|
||||
}
|
||||
|
||||
void AsmPrinter::printLabel(unsigned Id) const {
|
||||
|
@ -564,8 +564,6 @@ void ARMCodeEmitter::emitPseudoInstruction(const MachineInstr &MI) {
|
||||
break;
|
||||
}
|
||||
case TargetOpcode::DBG_LABEL:
|
||||
MCE.emitLabel(MMI->getLabelSym(MI.getOperand(0).getImm()));
|
||||
break;
|
||||
case TargetOpcode::EH_LABEL:
|
||||
MCE.emitLabel(MI.getOperand(0).getMCSymbol());
|
||||
break;
|
||||
|
@ -453,7 +453,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const
|
||||
if (hasDebugInfo) {
|
||||
// Mark effective beginning of when frame pointer becomes valid.
|
||||
FrameLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
}
|
||||
|
||||
// Adjust stack pointer, spilling $lr -> 16($sp) and $sp -> -FrameSize($sp)
|
||||
@ -515,7 +516,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const
|
||||
|
||||
// Mark effective beginning of when frame pointer is ready.
|
||||
unsigned ReadyLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addImm(ReadyLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(ReadyLabelId));
|
||||
|
||||
MachineLocation FPDst(SPU::R1);
|
||||
MachineLocation FPSrc(MachineLocation::VirtualFP);
|
||||
@ -531,7 +533,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const
|
||||
|
||||
// Insert terminator label
|
||||
unsigned BranchLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addImm(BranchLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(BranchLabelId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,8 +111,6 @@ void PPCCodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
|
||||
MCE.emitWordBE(getBinaryCodeForInstr(MI));
|
||||
break;
|
||||
case TargetOpcode::DBG_LABEL:
|
||||
MCE.emitLabel(MMI->getLabelSym(MI.getOperand(0).getImm()));
|
||||
break;
|
||||
case TargetOpcode::EH_LABEL:
|
||||
MCE.emitLabel(MI.getOperand(0).getMCSymbol());
|
||||
break;
|
||||
|
@ -1447,7 +1447,8 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
if (needsFrameMoves) {
|
||||
// Mark effective beginning of when frame pointer becomes valid.
|
||||
FrameLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
|
||||
// Show update of SP.
|
||||
if (NegFrameSize) {
|
||||
@ -1490,7 +1491,8 @@ PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
ReadyLabelId = MMI->NextLabelID();
|
||||
|
||||
// Mark effective beginning of when frame pointer is ready.
|
||||
BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addImm(ReadyLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(ReadyLabelId));
|
||||
|
||||
MachineLocation FPDst(HasFP ? (isPPC64 ? PPC::X31 : PPC::R31) :
|
||||
(isPPC64 ? PPC::X1 : PPC::R1));
|
||||
|
@ -603,8 +603,6 @@ void Emitter<CodeEmitter>::emitInstruction(const MachineInstr &MI,
|
||||
llvm_report_error("JIT does not support inline asm!");
|
||||
break;
|
||||
case TargetOpcode::DBG_LABEL:
|
||||
MCE.emitLabel(MMI->getLabelSym(MI.getOperand(0).getImm()));
|
||||
break;
|
||||
case TargetOpcode::GC_LABEL:
|
||||
case TargetOpcode::EH_LABEL:
|
||||
MCE.emitLabel(MI.getOperand(0).getMCSymbol());
|
||||
|
@ -960,7 +960,8 @@ 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)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
|
||||
// Define the current CFA rule to use the provided offset.
|
||||
if (StackSize) {
|
||||
@ -988,7 +989,8 @@ 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)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
|
||||
// Define the current CFA to use the EBP/RBP register.
|
||||
MachineLocation FPDst(FramePtr);
|
||||
@ -1028,7 +1030,8 @@ 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)).addImm(LabelId);
|
||||
BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(LabelId));
|
||||
|
||||
// Define the current CFA rule to use the provided offset.
|
||||
unsigned Ptr = StackSize ?
|
||||
@ -1100,7 +1103,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)).addImm(LabelId);
|
||||
BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(LabelId));
|
||||
|
||||
if (!HasFP && NumBytes) {
|
||||
// Define the current CFA rule to use the provided offset.
|
||||
|
@ -430,7 +430,8 @@ bool XCoreInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
it->getFrameIdx(), it->getRegClass());
|
||||
if (emitFrameMoves) {
|
||||
unsigned SaveLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL)).addImm(SaveLabelId);
|
||||
BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(SaveLabelId));
|
||||
XFI->getSpillLabels().push_back(
|
||||
std::pair<unsigned, CalleeSavedInfo>(SaveLabelId, *it));
|
||||
}
|
||||
|
@ -457,7 +457,8 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
// Show update of SP.
|
||||
unsigned FrameLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
|
||||
MachineLocation SPDst(MachineLocation::VirtualFP);
|
||||
MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize * 4);
|
||||
@ -476,7 +477,8 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
if (emitFrameMoves) {
|
||||
unsigned SaveLRLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addImm(SaveLRLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(SaveLRLabelId));
|
||||
MachineLocation CSDst(MachineLocation::VirtualFP, LRSpillOffset);
|
||||
MachineLocation CSSrc(XCore::LR);
|
||||
MMI->getFrameMoves().push_back(MachineMove(SaveLRLabelId,
|
||||
@ -493,7 +495,8 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
MBB.addLiveIn(XCore::R10);
|
||||
if (emitFrameMoves) {
|
||||
unsigned SaveR10LabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addImm(SaveR10LabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(SaveR10LabelId));
|
||||
MachineLocation CSDst(MachineLocation::VirtualFP, FPSpillOffset);
|
||||
MachineLocation CSSrc(XCore::R10);
|
||||
MMI->getFrameMoves().push_back(MachineMove(SaveR10LabelId,
|
||||
@ -506,7 +509,8 @@ void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
if (emitFrameMoves) {
|
||||
// Show FP is now valid.
|
||||
unsigned FrameLabelId = MMI->NextLabelID();
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addImm(FrameLabelId);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
|
||||
.addSym(MMI->getLabelSym(FrameLabelId));
|
||||
MachineLocation SPDst(FramePtr);
|
||||
MachineLocation SPSrc(MachineLocation::VirtualFP);
|
||||
MMI->getFrameMoves().push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
|
||||
|
Loading…
Reference in New Issue
Block a user