Skip to content

coverage: Extract safe FFI wrapper functions to llvm_cov #132452

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Nov 1, 2024

This PR takes all of the inline unsafe calls in coverage codegen, and all the safe wrapper functions in coverageinfo/mod.rs, and moves them to a new llvm_cov submodule that is dedicated to safe FFI wrapper functions. This reduces the mixing of abstraction levels in the rest of coverage codegen.

As a follow-up, this PR also tidies up the names and signatures of several of the coverage FFI functions.

@Zalathar Zalathar added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Nov 1, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 1, 2024

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 1, 2024
@Zalathar
Copy link
Contributor Author

Zalathar commented Nov 1, 2024

Follow-up to #131962 (comment).

@bors
Copy link
Collaborator

bors commented Nov 4, 2024

☔ The latest upstream changes (presumably #132581) made this pull request unmergeable. Please resolve the merge conflicts.

@Zalathar Zalathar force-pushed the llvm-cov-wrappers branch 2 times, most recently from 88451ee to 89ce0fb Compare November 5, 2024 04:29
@Zalathar
Copy link
Contributor Author

Zalathar commented Nov 5, 2024

Reverted the small change to VirtualFileMapping to avoid conflicts with other things I'm working on (diff).

@jieyouxu
Copy link
Member

jieyouxu commented Nov 7, 2024

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned chenyukang Nov 7, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +96 to +97
/// as a raw numeric value. For historical reasons, the numeric value is 1 less
/// than the number in the version's name, so `Version7` is actually `6u32`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@jieyouxu
Copy link
Member

jieyouxu commented Nov 8, 2024

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 8, 2024

📌 Commit 19d5dc0 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#132161 ([StableMIR] A few fixes to pretty printing)
 - rust-lang#132389 (coverage: Simplify parts of coverage graph creation)
 - rust-lang#132452 (coverage: Extract safe FFI wrapper functions to `llvm_cov`)
 - rust-lang#132590 (Simplify FFI calls for `-Ztime-llvm-passes` and `-Zprint-codegen-stats`)
 - rust-lang#132738 (Initialize channel `Block`s directly on the heap)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 758a904 into rust-lang:master Nov 8, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 8, 2024
@Zalathar Zalathar deleted the llvm-cov-wrappers branch November 8, 2024 10:28
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2024
Rollup merge of rust-lang#132452 - Zalathar:llvm-cov-wrappers, r=jieyouxu

coverage: Extract safe FFI wrapper functions to `llvm_cov`

This PR takes all of the inline `unsafe` calls in coverage codegen, and all the safe wrapper functions in `coverageinfo/mod.rs`, and moves them to a new `llvm_cov` submodule that is dedicated to safe FFI wrapper functions. This reduces the mixing of abstraction levels in the rest of coverage codegen.

As a follow-up, this PR also tidies up the names and signatures of several of the coverage FFI functions.
mati865 pushed a commit to mati865/rust that referenced this pull request Nov 12, 2024
…ouxu

coverage: Extract safe FFI wrapper functions to `llvm_cov`

This PR takes all of the inline `unsafe` calls in coverage codegen, and all the safe wrapper functions in `coverageinfo/mod.rs`, and moves them to a new `llvm_cov` submodule that is dedicated to safe FFI wrapper functions. This reduces the mixing of abstraction levels in the rest of coverage codegen.

As a follow-up, this PR also tidies up the names and signatures of several of the coverage FFI functions.
mati865 pushed a commit to mati865/rust that referenced this pull request Nov 12, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#132161 ([StableMIR] A few fixes to pretty printing)
 - rust-lang#132389 (coverage: Simplify parts of coverage graph creation)
 - rust-lang#132452 (coverage: Extract safe FFI wrapper functions to `llvm_cov`)
 - rust-lang#132590 (Simplify FFI calls for `-Ztime-llvm-passes` and `-Zprint-codegen-stats`)
 - rust-lang#132738 (Initialize channel `Block`s directly on the heap)

r? `@ghost`
`@rustbot` modify labels: rollup
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants