Uh oh!
There was an error while loading. Please reload this page.
Add template parameter debuginfo to generic types - #55010
Conversation
rust-highfive
commented
Oct 12, 2018
(rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
commented
Oct 12, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
tromey
commented
Oct 12, 2018
Fails when built against LLVM 5 or 6, works when LLVM is built in-tree. |
797f2ba to
670ea7bComparetromey
commented
Oct 15, 2018
Had to delay setting the type parameters until the struct was filled in; which makes sense, the mystery being why it failed with the in-tree LLVM. |
michaelwoerister
left a comment
There was a problem hiding this comment.
Thanks, @tromey! Looks good. However, would it be possible to use a single replaceArrays() call to set both the members and the type parameters? Then you wouldn't have to add LLVMRustDIBuilderReplaceTemplateParams (just extend adapt LLVMRustDICompositeTypeSetTypeArray).
Uh oh!
There was an error while loading. Please reload this page.
670ea7b to
8a3bb9aComparetromey
commented
Oct 22, 2018
Rebased + tried to address review comments. Let me know what you think. |
michaelwoerister
commented
Oct 23, 2018
Looks great, thank you! @bors r+ |
bors
commented
Oct 23, 2018
📌 Commit 8a3bb9a has been approved by |
… r=michaelwoerister Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closesrust-lang#9224
bors
commented
Oct 27, 2018
⌛ Testing commit 8a3bb9a with merge 7c41b8c778b18bd9c6e4446bd876adc655c2702f... |
bors
commented
Oct 27, 2018
💔 Test failed - status-appveyor |
kennytm
commented
Oct 27, 2018
Failed to stage 1 libcore on |
8a3bb9a to
2a3f38bComparemichaelwoerister
commented
Oct 30, 2018
@bors r+ |
bors
commented
Oct 30, 2018
📌 Commit 2a3f38bbff21cf2107b77d8051ff542095b7baca has been approved by |
bors
commented
Dec 2, 2018
⌛ Testing commit fb204cb with merge 4d3c2da893443aab6d006a629c4293a79004f8af... |
bors
commented
Dec 2, 2018
💔 Test failed - status-travis |
rust-highfive
commented
Dec 2, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
kennytm
commented
Dec 2, 2018
@bors retry cc SIGILL again |
bors
commented
Dec 2, 2018
⌛ Testing commit fb204cb with merge 00663a917413b848ac252805de30df2a051a5630... |
bors
commented
Dec 2, 2018
💔 Test failed - status-travis |
rust-highfive
commented
Dec 2, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
kennytm
commented
Dec 3, 2018
kennytm
commented
Dec 3, 2018
@bors p=47 |
…oerister Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes#9224
bors
commented
Dec 3, 2018
bors
commented
Dec 3, 2018
☀️ Test successful - status-appveyor, status-travis |
nnethercote
commented
Dec 17, 2018
This PR hurf performance on a few benchmarks, the worst by almost 5%. @tromey, any ideas how to ameliorate that? |
tromey
commented
Dec 18, 2018
The patch itself is pretty straightforward. Unless that new function ( One possible idea is that, since this debug info is primarily useful for pretty-printers, perhaps it could be limited to types where the generic parameters do not appear in any of the fields. Offhand I do not know whether this can be cheaply decided. |
nnethercote
commented
Dec 19, 2018
There were no slowdowns in |
michaelwoerister
commented
Dec 19, 2018
Incremental builds are affected more than non-incremental ones. The reason for this might be explained by incr. comp. producing more object files which causes more type information to be duplicated (because type information can't be shared between object files in LLVM). No simple, immediate fix comes to mind, unfortunately. At least only builds with full debuginfo should be affected. Line-info-only builds should be fine. |
tromey
commented
Dec 19, 2018
We should consider fixing this in LLVM. The problem is only going to get worse -- for example, I'd like to emit DWARF describing all the traits, which I imagine will result in much more IR. |
This changes debuginfo generation to add template parameters to
generic types. With this change the DWARF now has
DW_TAG_template_type_param for types, not just for functions, like:
<2><40d>: Abbrev Number: 6 (DW_TAG_structure_type)
<40e> DW_AT_name : (indirect string, offset: 0x375): Generic
<412> DW_AT_byte_size : 4
<413> DW_AT_alignment : 4
...
<3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param)
<420> DW_AT_type : <0x42a>
<424> DW_AT_name : (indirect string, offset: 0xa65e): T
Closes#9224