diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-06-09 18:01:51 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-06-09 18:01:51 +0000 |
| commit | 0ebe35b27897f784df9239cf79d3a4b0674364e8 (patch) | |
| tree | 3420f9db7a4588720317c42dfd808f42551b754e /llvm/lib/CodeGen | |
| parent | 372e9067a7594afda771769d9cf5ee1d30a7c831 (diff) | |
| download | bcm5719-llvm-0ebe35b27897f784df9239cf79d3a4b0674364e8.tar.gz bcm5719-llvm-0ebe35b27897f784df9239cf79d3a4b0674364e8.zip | |
Revert "[DWARF] Fix a few corner cases in expression emission"
This reverts commit r239380 due to apparently GDB regressions:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/22562
llvm-svn: 239420
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 37 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h | 3 |
3 files changed, 9 insertions, 33 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 3f6665bd576..e891ab9896b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1562,8 +1562,6 @@ void DwarfDebug::emitDebugLoc() { Asm->OutStreamer->EmitLabel(List.Label); const DwarfCompileUnit *CU = List.CU; for (const auto &Entry : DebugLocs.getEntries(List)) { - if (Entry.BeginSym == Entry.EndSym) - continue; // Set up the range. This range is relative to the entry point of the // compile unit. This is a hard coded 0 for low_pc when we're emitting // ranges, or the DW_AT_low_pc on the compile unit otherwise. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index d56982712d5..a2799b8d630 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -65,11 +65,6 @@ void DwarfExpression::AddShr(unsigned ShiftBy) { EmitOp(dwarf::DW_OP_shr); } -void DwarfExpression::AddOpStackValue() { - if (DwarfVersion >= 4) - EmitOp(dwarf::DW_OP_stack_value); -} - bool DwarfExpression::AddMachineRegIndirect(unsigned MachineReg, int Offset) { if (isFrameRegister(MachineReg)) { // If variable offset is based in frame register then use fbreg. @@ -177,14 +172,16 @@ void DwarfExpression::AddSignedConstant(int Value) { // value, so the producers and consumers started to rely on heuristics // to disambiguate the value vs. location status of the expression. // See PR21176 for more details. - AddOpStackValue(); + if (DwarfVersion >= 4) + EmitOp(dwarf::DW_OP_stack_value); } void DwarfExpression::AddUnsignedConstant(unsigned Value) { EmitOp(dwarf::DW_OP_constu); EmitUnsigned(Value); // cf. comment in DwarfExpression::AddSignedConstant(). - AddOpStackValue(); + if (DwarfVersion >= 4) + EmitOp(dwarf::DW_OP_stack_value); } static unsigned getOffsetOrZero(unsigned OffsetInBits, @@ -215,30 +212,15 @@ bool DwarfExpression::AddMachineRegExpression(const DIExpression *Expr, getOffsetOrZero(OffsetInBits, PieceOffsetInBits)); } case dwarf::DW_OP_plus: { + // [DW_OP_reg,Offset,DW_OP_plus,DW_OP_deref] --> [DW_OP_breg,Offset]. auto N = I.getNext(); - unsigned Offset = I->getArg(0); - // First combine all DW_OP_plus until we hit either a DW_OP_deref or a - // DW_OP_bit_piece - while (N != E && N->getOp() == dwarf::DW_OP_plus) { - Offset += N->getArg(0); - ++I; - N = I.getNext(); - } if (N != E && N->getOp() == dwarf::DW_OP_deref) { - // [DW_OP_reg,Offset,DW_OP_plus,DW_OP_deref] --> [DW_OP_breg,Offset]. + unsigned Offset = I->getArg(0); ValidReg = AddMachineRegIndirect(MachineReg, Offset); std::advance(I, 2); - } else { - assert ((N == E) || (N->getOp() == dwarf::DW_OP_bit_piece)); - if (Offset == 0) { - ValidReg = AddMachineRegPiece(MachineReg); - } else { - ValidReg = AddMachineRegIndirect(MachineReg, Offset); - AddOpStackValue(); - } - ++I; - } - break; + break; + } else + ValidReg = AddMachineRegPiece(MachineReg); } case dwarf::DW_OP_deref: { // [DW_OP_reg,DW_OP_deref] --> [DW_OP_breg]. @@ -255,7 +237,6 @@ bool DwarfExpression::AddMachineRegExpression(const DIExpression *Expr, // Emit remaining elements of the expression. AddExpression(I, E, PieceOffsetInBits); - return true; } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h index f6249fff425..78ec937a6b6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h @@ -83,9 +83,6 @@ public: bool AddMachineRegPiece(unsigned MachineReg, unsigned PieceSizeInBits = 0, unsigned PieceOffsetInBits = 0); - /// Emit a DW_OP_stack_value - void AddOpStackValue(); - /// Emit a signed constant. void AddSignedConstant(int Value); /// Emit an unsigned constant. |

