summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-06-20 00:25:24 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-06-20 00:25:24 +0000
commitea2605dc1a08114650fc2910046a6191ceb7481d (patch)
tree616f30de34d0b1f3d7c1637ac22044ab7a38fd1a /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parentb2d617de2cb31052a5f06ad57c64268c392c26c9 (diff)
downloadbcm5719-llvm-ea2605dc1a08114650fc2910046a6191ceb7481d.tar.gz
bcm5719-llvm-ea2605dc1a08114650fc2910046a6191ceb7481d.zip
DebugInfo: don't use location lists when the location covers the whole function anyway
Fix up three tests - one that was relying on abbreviation number, another relying on a location list in this case (& testing raw asm, changed that to use dwarfdump on the debug_info now that that's where the location is), and another which was added in r184368 - exposing a bug in that fix that is exposed when we emit the location inline rather than through a location list. Fix that bug while I'm here. llvm-svn: 184387
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 9e8f9aaa9a7..4c465435e59 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -348,7 +348,8 @@ void CompileUnit::addVariableAddress(DbgVariable *&DV, DIE *Die,
else if (DV->isBlockByrefVariable())
addBlockByrefAddress(DV, Die, dwarf::DW_AT_location, Location);
else
- addAddress(Die, dwarf::DW_AT_location, Location);
+ addAddress(Die, dwarf::DW_AT_location, Location,
+ DV->getVariable().isIndirect());
}
/// addRegisterOp - Add register operand.
@@ -384,13 +385,17 @@ void CompileUnit::addRegisterOffset(DIE *TheDie, unsigned Reg,
/// addAddress - Add an address attribute to a die based on the location
/// provided.
void CompileUnit::addAddress(DIE *Die, unsigned Attribute,
- const MachineLocation &Location) {
+ const MachineLocation &Location, bool Indirect) {
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
- if (Location.isReg())
+ if (Location.isReg() && !Indirect)
addRegisterOp(Block, Location.getReg());
- else
+ else {
addRegisterOffset(Block, Location.getReg(), Location.getOffset());
+ if (Indirect && !Location.isReg()) {
+ addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_deref);
+ }
+ }
// Now attach the location information to the DIE.
addBlock(Die, Attribute, 0, Block);
OpenPOWER on IntegriCloud