mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Remove the MachineMove class.
It was just a less powerful and more confusing version of MCCFIInstruction. A side effect is that, since MCCFIInstruction uses dwarf register numbers, calls to getDwarfRegNum are pushed out, which should allow further simplifications. I left the MachineModuleInfo::addFrameMove interface unchanged since this patch was already fairly big. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -169,28 +169,21 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
|
||||
// Dwarf Lowering Routines
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// EmitCFIFrameMove - Emit a frame instruction.
|
||||
void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
|
||||
const TargetRegisterInfo *RI = TM.getRegisterInfo();
|
||||
|
||||
const MachineLocation &Dst = Move.getDestination();
|
||||
const MachineLocation &Src = Move.getSource();
|
||||
|
||||
// If advancing cfa.
|
||||
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
|
||||
if (Src.getReg() == MachineLocation::VirtualFP) {
|
||||
OutStreamer.EmitCFIDefCfaOffset(-Src.getOffset());
|
||||
} else {
|
||||
// Reg + Offset
|
||||
OutStreamer.EmitCFIDefCfa(RI->getDwarfRegNum(Src.getReg(), true),
|
||||
Src.getOffset());
|
||||
}
|
||||
} else if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
|
||||
assert(Dst.isReg() && "Machine move not supported yet.");
|
||||
OutStreamer.EmitCFIDefCfaRegister(RI->getDwarfRegNum(Dst.getReg(), true));
|
||||
} else {
|
||||
assert(!Dst.isReg() && "Machine move not supported yet.");
|
||||
OutStreamer.EmitCFIOffset(RI->getDwarfRegNum(Src.getReg(), true),
|
||||
Dst.getOffset());
|
||||
void AsmPrinter::emitCFIInstruction(const MCCFIInstruction &Inst) const {
|
||||
switch (Inst.getOperation()) {
|
||||
default:
|
||||
llvm_unreachable("Unexpected instruction");
|
||||
case MCCFIInstruction::OpDefCfaOffset:
|
||||
OutStreamer.EmitCFIDefCfaOffset(Inst.getOffset());
|
||||
break;
|
||||
case MCCFIInstruction::OpDefCfa:
|
||||
OutStreamer.EmitCFIDefCfa(Inst.getRegister(), Inst.getOffset());
|
||||
break;
|
||||
case MCCFIInstruction::OpDefCfaRegister:
|
||||
OutStreamer.EmitCFIDefCfaRegister(Inst.getRegister());
|
||||
break;
|
||||
case MCCFIInstruction::OpOffset:
|
||||
OutStreamer.EmitCFIOffset(Inst.getRegister(), Inst.getOffset());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user