[PATCH] [DWARF] Fix a few corner cases in expression emission

Keno Fischer kfischer at college.harvard.edu
Mon Jun 8 11:56:10 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:219
@@ -214,3 +218,3 @@
   case dwarf::DW_OP_plus: {
     // [DW_OP_reg,Offset,DW_OP_plus,DW_OP_deref] --> [DW_OP_breg,Offset].
     auto N = I.getNext();
----------------
aprantl wrote:
> This comment now needs to be moved down to the "if (DW_OP_deref)" block.
Will move.

================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:237
@@ +236,3 @@
+      } else {
+        ValidReg = AddMachineRegIndirect(MachineReg, Offset);
+        IsOnStack = true;
----------------
aprantl wrote:
> The indirection here seems wrong:
> To reach this clause, we need an expression like "DW_OP_reg Offset DW_OP_plus (DW_OP_bit_Piece x y)?"
> Shouldn't this be just an unconditional AddMachineRegPiece()?
We could also be in the case that `N == E`. I think the right thing to do is actually to put the `AddOpStackValue();` here, `AddExpression` below will add the DW_OP_piece if there is one.

http://reviews.llvm.org/D10302

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list