llvm-project/llvm/test/DebugInfo/MIR/X86
Jeremy Morse d2b6665e33 [DebugInfo] Avoid adding too much indirection to pointer-valued variables
This patch addresses PR41675, where a stack-pointer variable is dereferenced
too many times by its location expression, presenting a value on the stack as
the pointer to the stack.

The difference between a stack *pointer* DBG_VALUE and one that refers to a
value on the stack, is currently the indirect flag. However the DWARF backend
will also try to guess whether something is a memory location or not, based
on whether there is any computation in the location expression. By simply
prepending the stack offset to existing expressions, we can accidentally
convert a register location into a memory location, which introduces a
suprise (and unintended) dereference.

The solution is to add DW_OP_stack_value whenever we add a DIExpression
computation to a stack *pointer*. It's an implicit location computed on the
expression stack, thus needs to be flagged as a stack_value.

For the edge case where the offset is zero and the location could be a register
location, DIExpression::prepend will still generate opcodes, and thus
DW_OP_stack_value must still be added.

Differential Revision: https://reviews.llvm.org/D63429

llvm-svn: 364736
2019-07-01 09:38:23 +00:00
..
bit-piece-dh.mir MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
clobbered-fragments.mir [DebugInfo] Track multiple registers in DbgEntityHistoryCalculator 2019-04-10 11:28:28 +00:00
dbg-stack-value-range.mir Describe stack-id as an enum 2019-06-17 09:13:29 +00:00
debug-loc-0.mir Describe stack-id as an enum 2019-06-17 09:13:29 +00:00
empty-inline.mir [X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand. 2019-04-05 19:28:09 +00:00
kill-after-spill.mir Describe stack-id as an enum 2019-06-17 09:13:29 +00:00
lit.local.cfg
live-debug-values-3preds.mir [X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand. 2019-04-05 19:28:09 +00:00
live-debug-values-fragments.mir [X86] Add target triple for live-debug-values-fragments.mir 2019-06-14 01:41:04 +00:00
live-debug-values-reg-copy.mir Describe stack-id as an enum 2019-06-17 09:13:29 +00:00
live-debug-values-restore.mir Describe stack-id as an enum 2019-06-17 09:13:29 +00:00
live-debug-values-spill.mir [X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand. 2019-04-05 19:28:09 +00:00
live-debug-values.mir [X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand. 2019-04-05 19:28:09 +00:00
live-debug-vars-unused-arg-debugonly.mir MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
live-debug-vars-unused-arg.mir MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
livedebugvalues-limit.mir [X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand. 2019-04-05 19:28:09 +00:00
mlicm-hoist.mir MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
no-cfi-loc.mir [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
prolog-epilog-indirection.mir [DebugInfo] Avoid adding too much indirection to pointer-valued variables 2019-07-01 09:38:23 +00:00
regcoalescer.mir MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
regcoalescing-clears-dead-dbgvals.mir Add triple to a test I just added. 2019-06-27 11:52:03 +00:00