mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Hoist all of the Entry.getLoc() calls int a single variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d0782ae93
commit
7c2f3e8944
@ -2462,17 +2462,18 @@ void DwarfDebug::emitDebugLoc() {
|
||||
Asm->EmitULEB128(Entry.getInt());
|
||||
}
|
||||
} else if (Entry.isLocation()) {
|
||||
MachineLocation Loc = Entry.getLoc();
|
||||
if (!DV.hasComplexAddress())
|
||||
// Regular entry.
|
||||
Asm->EmitDwarfRegOp(Entry.getLoc(), DV.isIndirect());
|
||||
Asm->EmitDwarfRegOp(Loc, DV.isIndirect());
|
||||
else {
|
||||
// Complex address entry.
|
||||
unsigned N = DV.getNumAddrElements();
|
||||
unsigned i = 0;
|
||||
if (N >= 2 && DV.getAddrElement(0) == DIBuilder::OpPlus) {
|
||||
if (Entry.getLoc().getOffset()) {
|
||||
if (Loc.getOffset()) {
|
||||
i = 2;
|
||||
Asm->EmitDwarfRegOp(Entry.getLoc(), DV.isIndirect());
|
||||
Asm->EmitDwarfRegOp(Loc, DV.isIndirect());
|
||||
Asm->OutStreamer.AddComment("DW_OP_deref");
|
||||
Asm->EmitInt8(dwarf::DW_OP_deref);
|
||||
Asm->OutStreamer.AddComment("DW_OP_plus_uconst");
|
||||
@ -2481,12 +2482,12 @@ void DwarfDebug::emitDebugLoc() {
|
||||
} else {
|
||||
// If first address element is OpPlus then emit
|
||||
// DW_OP_breg + Offset instead of DW_OP_reg + Offset.
|
||||
MachineLocation Loc(Entry.getLoc().getReg(), DV.getAddrElement(1));
|
||||
Asm->EmitDwarfRegOp(Loc, DV.isIndirect());
|
||||
MachineLocation TLoc(Loc.getReg(), DV.getAddrElement(1));
|
||||
Asm->EmitDwarfRegOp(TLoc, DV.isIndirect());
|
||||
i = 2;
|
||||
}
|
||||
} else {
|
||||
Asm->EmitDwarfRegOp(Entry.getLoc(), DV.isIndirect());
|
||||
Asm->EmitDwarfRegOp(Loc, DV.isIndirect());
|
||||
}
|
||||
|
||||
// Emit remaining complex address elements.
|
||||
@ -2496,7 +2497,7 @@ void DwarfDebug::emitDebugLoc() {
|
||||
Asm->EmitInt8(dwarf::DW_OP_plus_uconst);
|
||||
Asm->EmitULEB128(DV.getAddrElement(++i));
|
||||
} else if (Element == DIBuilder::OpDeref) {
|
||||
if (!Entry.getLoc().isReg())
|
||||
if (!Loc.isReg())
|
||||
Asm->EmitInt8(dwarf::DW_OP_deref);
|
||||
} else
|
||||
llvm_unreachable("unknown Opcode found in complex address");
|
||||
|
Loading…
Reference in New Issue
Block a user