In some scenarios, usually involving NRVO, we can issue indirect DBG_VALUEs after SelectionDAG, even in instruction referencing mode (if the variable is an argument). If the corresponding argument value is spilt to the stack, then we have:
- Indirection because it's on the stack,
- Indirection because of the nature of the variable (i.e., it was created with indirection),
However InstrRefBasedLDV only emits one level of indirection. This patch adds the second, by adding an extra DW_OP_deref if necessary.
The two tests modified fail otherwise -- they feature some NRVO, and require two levels of indirection to be correct.
(An alternate solution would be to stop emitting DBG_VALUEs with indirection -- that'll probably work, but I think it should be part of a refactor. InstrRefBasedLDV is agnostic as to whether it's working on DBG_INSTR_REFs or DBG_VALUEs, I might have baked more assumptions into it).