rename rustc_allocator_nounwind to rustc_nounwind
This commit is contained in:
parent
db0597f561
commit
2b50cd1877
6 changed files with 14 additions and 10 deletions
|
@ -536,7 +536,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_reallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_reallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_deallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_deallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_allocator_zeroed, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_allocator_zeroed, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
|
|
|
@ -1649,7 +1649,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
}
|
}
|
||||||
} else if attr.has_name(sym::rustc_allocator_nounwind) {
|
} else if attr.has_name(sym::rustc_nounwind) {
|
||||||
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NEVER_UNWIND;
|
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NEVER_UNWIND;
|
||||||
} else if attr.has_name(sym::rustc_reallocator) {
|
} else if attr.has_name(sym::rustc_reallocator) {
|
||||||
codegen_fn_attrs.flags |= CodegenFnAttrFlags::REALLOCATOR;
|
codegen_fn_attrs.flags |= CodegenFnAttrFlags::REALLOCATOR;
|
||||||
|
|
|
@ -1231,7 +1231,6 @@ symbols! {
|
||||||
rust_oom,
|
rust_oom,
|
||||||
rustc,
|
rustc,
|
||||||
rustc_allocator,
|
rustc_allocator,
|
||||||
rustc_allocator_nounwind,
|
|
||||||
rustc_allocator_zeroed,
|
rustc_allocator_zeroed,
|
||||||
rustc_allow_const_fn_unstable,
|
rustc_allow_const_fn_unstable,
|
||||||
rustc_allow_incoherent_impl,
|
rustc_allow_incoherent_impl,
|
||||||
|
@ -1278,6 +1277,7 @@ symbols! {
|
||||||
rustc_mir,
|
rustc_mir,
|
||||||
rustc_must_implement_one_of,
|
rustc_must_implement_one_of,
|
||||||
rustc_nonnull_optimization_guaranteed,
|
rustc_nonnull_optimization_guaranteed,
|
||||||
|
rustc_nounwind,
|
||||||
rustc_object_lifetime_default,
|
rustc_object_lifetime_default,
|
||||||
rustc_on_unimplemented,
|
rustc_on_unimplemented,
|
||||||
rustc_outlives,
|
rustc_outlives,
|
||||||
|
|
|
@ -28,16 +28,20 @@ extern "Rust" {
|
||||||
// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to optimize them
|
// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to optimize them
|
||||||
// like `malloc`, `realloc`, and `free`, respectively.
|
// like `malloc`, `realloc`, and `free`, respectively.
|
||||||
#[rustc_allocator]
|
#[rustc_allocator]
|
||||||
#[rustc_allocator_nounwind]
|
#[cfg_attr(not(bootstrap), rustc_nounwind)]
|
||||||
|
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
|
||||||
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
|
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
|
||||||
#[rustc_deallocator]
|
#[rustc_deallocator]
|
||||||
#[rustc_allocator_nounwind]
|
#[cfg_attr(not(bootstrap), rustc_nounwind)]
|
||||||
|
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
|
||||||
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
|
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
|
||||||
#[rustc_reallocator]
|
#[rustc_reallocator]
|
||||||
#[rustc_allocator_nounwind]
|
#[cfg_attr(not(bootstrap), rustc_nounwind)]
|
||||||
|
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
|
||||||
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
|
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
|
||||||
#[rustc_allocator_zeroed]
|
#[rustc_allocator_zeroed]
|
||||||
#[rustc_allocator_nounwind]
|
#[cfg_attr(not(bootstrap), rustc_nounwind)]
|
||||||
|
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
|
||||||
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
|
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//@revisions: extern_block definition both
|
//@revisions: extern_block definition both
|
||||||
#![feature(rustc_attrs, c_unwind)]
|
#![feature(rustc_attrs, c_unwind)]
|
||||||
|
|
||||||
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]
|
#[cfg_attr(any(definition, both), rustc_nounwind)]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
extern "C-unwind" fn nounwind() {
|
extern "C-unwind" fn nounwind() {
|
||||||
//[definition]~^ ERROR: abnormal termination: the program aborted execution
|
//[definition]~^ ERROR: abnormal termination: the program aborted execution
|
||||||
|
@ -11,7 +11,7 @@ extern "C-unwind" fn nounwind() {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
extern "C-unwind" {
|
extern "C-unwind" {
|
||||||
#[cfg_attr(any(extern_block, both), rustc_allocator_nounwind)]
|
#[cfg_attr(any(extern_block, both), rustc_nounwind)]
|
||||||
fn nounwind();
|
fn nounwind();
|
||||||
}
|
}
|
||||||
unsafe { nounwind() }
|
unsafe { nounwind() }
|
||||||
|
|
|
@ -379,7 +379,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
rustc_attr!(rustc_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
gated!(
|
gated!(
|
||||||
alloc_error_handler, Normal, template!(Word), WarnFollowing,
|
alloc_error_handler, Normal, template!(Word), WarnFollowing,
|
||||||
experimental!(alloc_error_handler)
|
experimental!(alloc_error_handler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue