This patch enables AsmPrinter support for complex expression with entry values. It shouldn't AsmPrinter's call whether these are safe or not but the pass who introduces the DW_OP_LLVM_entry_value. This patch on its own has no effect on clang.
The 1 is for the number of expression operands (including the DBG_VALUE value operand, i.e. in this case $edi) that the DW_OP_LLVM_entry_value covers. The actual byte size operand of the to-be-emitted DW_OP_entry_value operation is then calculated by getTemporaryBufferSize() in finalizeEntryValue().
DW_OP_entry_value could be used in the expressions representing DW_AT_call_value within DW_TAG_call_site_parameter, and I think we should be printing the DW_OP_stack_value in these.
NIt: we can get rid of these
I am just wondering, do we need the changes from D87357 regarding the DwarfExpression::addExpression()?
case dwarf::DW_OP_plus_uconst: - assert(!isRegisterLocation()); + assert(!isRegisterLocation() || isEntryValue()); emitOp(dwarf::DW_OP_plus_uconst); emitUnsigned(Op->getArg(0)); break;
It seems reasonable to me to split out AsmPrinter support for complex entry values from the change(s) to start emitting them. @djtodoro any concerns?
Maybe expand the comment with:
Sorry about that, I inexplicably skipped over the $edi operand on my first pass through.