From f7435ee6cec52e0af8dc36bef55efef375cf79e6 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 2 Nov 2014 06:46:40 +0000 Subject: [PATCH] Push DwarfUnit::addAddress down into DwarfCompileUnit llvm-svn: 221085 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 19 +++++++++++++++++++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 3 +++ llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 19 ------------------- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 5 ----- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 142d32e..76b5868 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -724,4 +724,23 @@ void DwarfCompileUnit::addVariableAddress(const DbgVariable &DV, DIE &Die, addAddress(Die, dwarf::DW_AT_location, Location, DV.getVariable().isIndirect()); } + +/// Add an address attribute to a die based on the location provided. +void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, + const MachineLocation &Location, + bool Indirect) { + DIELoc *Loc = new (DIEValueAllocator) DIELoc(); + + if (Location.isReg() && !Indirect) + addRegisterOpPiece(*Loc, Location.getReg()); + else { + addRegisterOffset(*Loc, Location.getReg(), Location.getOffset()); + if (Indirect && !Location.isReg()) { + addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_deref); + } + } + + // Now attach the location information to the DIE. + addBlock(Die, Attribute, Loc); +} } // end llvm namespace diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index a98c141..82b52b1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -196,6 +196,9 @@ public: /// MachineLocation. void addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location); + /// Add an address attribute to a die based on the location provided. + void addAddress(DIE &Die, dwarf::Attribute Attribute, + const MachineLocation &Location, bool Indirect = false); }; } // end llvm namespace diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index dc85545..ff2c1a5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -493,25 +493,6 @@ void DwarfUnit::addRegisterOffset(DIELoc &TheDie, unsigned Reg, addSInt(TheDie, dwarf::DW_FORM_sdata, Offset); } -/// addAddress - Add an address attribute to a die based on the location -/// provided. -void DwarfUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, - const MachineLocation &Location, bool Indirect) { - DIELoc *Loc = new (DIEValueAllocator) DIELoc(); - - if (Location.isReg() && !Indirect) - addRegisterOpPiece(*Loc, Location.getReg()); - else { - addRegisterOffset(*Loc, Location.getReg(), Location.getOffset()); - if (Indirect && !Location.isReg()) { - addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_deref); - } - } - - // Now attach the location information to the DIE. - addBlock(Die, Attribute, Loc); -} - /// addComplexAddress - Start with the address based on the location provided, /// and generate the DWARF information necessary to find the actual variable /// given the extra address information encoded in the DbgVariable, starting diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h index ec04780..a314ee8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -262,11 +262,6 @@ public: void addSourceLine(DIE &Die, DINameSpace NS); void addSourceLine(DIE &Die, DIObjCProperty Ty); - /// addAddress - Add an address attribute to a die based on the location - /// provided. - void addAddress(DIE &Die, dwarf::Attribute Attribute, - const MachineLocation &Location, bool Indirect = false); - /// addConstantValue - Add constant value entry in variable DIE. void addConstantValue(DIE &Die, const MachineOperand &MO, DIType Ty); void addConstantValue(DIE &Die, const ConstantInt *CI, DIType Ty); -- 2.7.4