Commit b21c438
authored
Rollup merge of rust-lang#146635 - Zalathar:llvm-cov, r=SparrowLii
cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings
[As explained by a note in `ffi.rs`](https://github.com/rust-lang/rust/blob/8a1b39995e5b630c5872f5de5079f1f569bd5ac2/compiler/rustc_codegen_llvm/src/llvm/ffi.rs#L4-L11), passing strings and byte slices through FFI is more convenient if we take advantage of the fact that `*const c_uchar` and `*const c_char` have the same ABI.
Doing so avoids having to rely on a special helper function, since we can just call `as_ptr` instead.
(The same logic applies to every other binding that currently uses the `as_c_char_ptr` helper; I just haven't adjusted all of them yet.)
---
As a drive-by change, this PR also marks some coverage-related FFI bindings as `safe`.File tree
2 files changed
+26
-17
lines changed- compiler/rustc_codegen_llvm/src
- coverageinfo
- llvm
2 files changed
+26
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | | - | |
| 98 | + | |
100 | 99 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2256 | 2256 | | |
2257 | 2257 | | |
2258 | 2258 | | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
2259 | 2262 | | |
2260 | | - | |
| 2263 | + | |
2261 | 2264 | | |
2262 | 2265 | | |
2263 | 2266 | | |
| |||
2280 | 2283 | | |
2281 | 2284 | | |
2282 | 2285 | | |
2283 | | - | |
| 2286 | + | |
2284 | 2287 | | |
2285 | 2288 | | |
2286 | | - | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
2287 | 2293 | | |
2288 | | - | |
2289 | | - | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
2293 | 2303 | | |
2294 | | - | |
| 2304 | + | |
2295 | 2305 | | |
2296 | 2306 | | |
2297 | 2307 | | |
| |||
0 commit comments