[PATCH] D68209: [LiveDebugValues] Introduce entry values of unmodified params

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 08:38:26 PST 2019


dstenb added a comment.

In D68209#1755217 <https://reviews.llvm.org/D68209#1755217>, @djtodoro wrote:

> At the moment, we should avoid creating the entry value for the `sink` variable.


At the risk that I'm overlooking something here, but isn't it safe to emit an entry value in that case? The variable is a reference, so the debug location is an address rather than an value. Shouldn't it be safe to emit an entry value for the address regardless of what types of modification are made to the data inside the function? Using the same argument, I assume that there shouldn't be a need to emit a dbg.value after `++sink;`?

Here is what GCC emits for that variable:

  0x00000050:     DW_TAG_formal_parameter
                    DW_AT_name    ("sink")
                    DW_AT_decl_file       ("/path/to/foo.cpp")
                    DW_AT_decl_line       (12)
                    DW_AT_decl_column     (0x11)
                    DW_AT_type    (0x00000084 "int&")
                    DW_AT_location        (0x0000000c: 
                       [0x0000000000000000, 0x0000000000000006): DW_OP_reg5 RDI
                       [0x0000000000000006, 0x0000000000000012): DW_OP_reg3 RBX
                       [0x0000000000000012, 0x0000000000000013): DW_OP_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value)




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68209/new/

https://reviews.llvm.org/D68209





More information about the llvm-commits mailing list