-
Notifications
You must be signed in to change notification settings - Fork 13.3k
codegen_llvm: set DW_AT_accessibility
#115165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
codegen_llvm: set DW_AT_accessibility
#115165
Conversation
376f738
to
1f83e77
Compare
type_did: DefId, | ||
) -> DIFlags { | ||
let parent_did = cx.tcx.parent(type_did); | ||
let visibility = cx.tcx.visibility(did); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to comment that it might make more sense to calculate the visibility from the perspective of the crate root (or, rather, as if you were using the crate as a dependency?) but I don't see why that necessarily be better and the current implementation is simpler and matches the visibility of the declaration site (even if the effective visibility ends up being more hidden due to the visibility/exports of parent modules).
Just noting that is another possible way to implement this but I don't see a strong reason to do that at this time.
Thanks @davidtwco! @bors r+ |
…ember-visibility, r=wesleywiser codegen_llvm: set `DW_AT_accessibility` Fixes rust-lang#9228. Based on rust-lang#74778. Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute. `DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust, but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway. r? `@wesleywiser` (visited in wg-debugging triage)
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
1f83e77
to
02682de
Compare
I've split the test up into different files for each type - as far as I can tell the test fails in CI because of the order of items in the LLVM IR. |
@bors r+ |
…ember-visibility, r=wesleywiser codegen_llvm: set `DW_AT_accessibility` Fixes rust-lang#9228. Based on rust-lang#74778. Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute. `DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust, but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway. r? `@wesleywiser` (visited in wg-debugging triage)
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
02682de
to
1b857fb
Compare
Rebased and fixed tidy errors, will r+ once CI is passing. |
@bors r=wesleywiser |
…ember-visibility, r=wesleywiser codegen_llvm: set `DW_AT_accessibility` Fixes rust-lang#9228. Based on rust-lang#74778. Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute. `DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust, but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway. r? `@wesleywiser` (visited in wg-debugging triage)
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
…ember-visibility, r=wesleywiser codegen_llvm: set `DW_AT_accessibility` Fixes rust-lang#9228. Based on rust-lang#74778. Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute. `DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust, but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway. r? `@wesleywiser` (visited in wg-debugging triage)
☀️ Test successful - checks-actions |
Finished benchmarking commit (3f39cae): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 673.805s -> 671.537s (-0.34%) |
The wins here are actually the end of the noise spike from the PR merged before this one returning to steady-state. The 4 regressions look real though and make sense, with more debuginfo data (seen in the binary size increase), and that should come with more work e.g. in the linker (cc @Kobzol: maybe we should normalize/show absolute values in the frontend/backend/linker perf.rlo sections for these cases where we know the total and ratio have changed, but can't compare the sections themselves as they're relative. But maybe using wall-time, until we re-land the switch to storing icounts in measureme, and noise would prevent from seeing actual signal in these small changes there anyways). Note that we can put a lesser emphasis on the 2 regressions on The regressions are pretty small, so probably not worth looking into much further imho. |
Fixes #9228.
Based on #74778.
Sets the accessibility of types and fields in DWARF using
DW_AT_accessibility
attribute.DW_AT_accessibility
(public/protected/private) isn't exactly right for Rust, but neither isDW_AT_visibility
(local/exported/qualified), and there's no way to setDW_AT_visbility
in LLVM's API. Debuggers will special-case the handling of these per-language anyway.r? @wesleywiser (visited in wg-debugging triage)