diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-08-07 00:06:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-07 00:06:07 +0200 |
| commit | 1ea9951b435c23399008e47a75215dc4931d09ad (patch) | |
| tree | 8eeb6b8d54afe9481d881352e558e00ea9726b93 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp | |
| parent | d720f93a62889dd956ad4efaf42e73075a3f06ac (diff) | |
| parent | 704aa56ba0f3b42499f97b14b2f7a2bfb0761b0e (diff) | |
| download | rust-1ea9951b435c23399008e47a75215dc4931d09ad.tar.gz rust-1ea9951b435c23399008e47a75215dc4931d09ad.zip | |
Rollup merge of #114550 - dtolnay:globalalloc, r=compiler-errors
Generate better function argument names in global_allocator expansion
Generated code for `#[global_allocator] static ALLOCATOR: Allocator = Allocator;`—
**Before:**
```rust
const _: () = {
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc(arg0: usize, arg1: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(arg0, arg1),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_dealloc(arg0: *mut u8, arg1: usize, arg2: usize) -> () {
::core::alloc::GlobalAlloc::dealloc(
&ALLOCATOR,
arg0,
::core::alloc::Layout::from_size_align_unchecked(arg1, arg2),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_realloc(
arg0: *mut u8,
arg1: usize,
arg2: usize,
arg3: usize,
) -> *mut u8 {
::core::alloc::GlobalAlloc::realloc(
&ALLOCATOR,
arg0,
::core::alloc::Layout::from_size_align_unchecked(arg1, arg2),
arg3,
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc_zeroed(arg0: usize, arg1: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc_zeroed(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(arg0, arg1),
)
}
};
```
**After:**
```rust
const _: () = {
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc(size: usize, align: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize) -> () {
::core::alloc::GlobalAlloc::dealloc(
&ALLOCATOR,
ptr,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_realloc(
ptr: *mut u8,
size: usize,
align: usize,
new_size: usize,
) -> *mut u8 {
::core::alloc::GlobalAlloc::realloc(
&ALLOCATOR,
ptr,
::core::alloc::Layout::from_size_align_unchecked(size, align),
new_size,
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc_zeroed(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
};
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
