mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-04 10:30:01 +00:00
simplify code and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100369 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6189ed10c1
commit
786d17a0cf
@ -70,43 +70,40 @@ void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel,
|
||||
|
||||
// If advancing cfa.
|
||||
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
|
||||
if (!Src.isReg()) {
|
||||
if (Src.getReg() == MachineLocation::VirtualFP) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
|
||||
} else {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa);
|
||||
Asm->EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
|
||||
}
|
||||
assert(!Src.isReg() && "Machine move not supported yet.");
|
||||
|
||||
int Offset = -Src.getOffset();
|
||||
Asm->EmitULEB128(Offset, "Offset");
|
||||
if (Src.getReg() == MachineLocation::VirtualFP) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
|
||||
} else {
|
||||
llvm_unreachable("Machine move not supported yet.");
|
||||
}
|
||||
} else if (Src.isReg() &&
|
||||
Src.getReg() == MachineLocation::VirtualFP) {
|
||||
if (Dst.isReg()) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
|
||||
Asm->EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
|
||||
} else {
|
||||
llvm_unreachable("Machine move not supported yet.");
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa);
|
||||
Asm->EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
|
||||
}
|
||||
|
||||
Asm->EmitULEB128(-Src.getOffset(), "Offset");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
|
||||
assert(Dst.isReg() && "Machine move not supported yet.");
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
|
||||
Asm->EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
|
||||
int Offset = Dst.getOffset() / stackGrowth;
|
||||
|
||||
if (Offset < 0) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
|
||||
Asm->EmitULEB128(Reg, "Reg");
|
||||
Asm->EmitSLEB128(Offset, "Offset");
|
||||
} else if (Reg < 64) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset + Reg);
|
||||
Asm->EmitULEB128(Offset, "Offset");
|
||||
} else {
|
||||
unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
|
||||
int Offset = Dst.getOffset() / stackGrowth;
|
||||
|
||||
if (Offset < 0) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
|
||||
Asm->EmitULEB128(Reg, "Reg");
|
||||
Asm->EmitSLEB128(Offset, "Offset");
|
||||
} else if (Reg < 64) {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset + Reg);
|
||||
Asm->EmitULEB128(Offset, "Offset");
|
||||
} else {
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended);
|
||||
Asm->EmitULEB128(Reg, "Reg");
|
||||
Asm->EmitULEB128(Offset, "Offset");
|
||||
}
|
||||
Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended);
|
||||
Asm->EmitULEB128(Reg, "Reg");
|
||||
Asm->EmitULEB128(Offset, "Offset");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user