rust/compiler/rustc_codegen_ssa/src/traits
Amanieu d'Antras 56074b5231 Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (#102318).
2022-10-31 16:32:57 +00:00
..
abi.rs Merge apply_attrs_callsite into call and invoke 2022-10-01 17:01:31 +00:00
asm.rs Add codegen for global_asm! sym operands 2022-04-15 14:36:30 +01:00
backend.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
builder.rs Remove type argument of array_alloca and rename to byte_array_alloca 2022-10-02 13:42:14 +00:00
consts.rs Remove dead broken code from const zst handling in backends 2022-09-06 14:09:49 +00:00
coverageinfo.rs Stabilize -Z instrument-coverage as -C instrument-coverage 2022-01-01 15:57:35 -08:00
debuginfo.rs debuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo() 2022-03-14 17:25:24 +01:00
declare.rs Remove DeclareMethods 2020-09-18 13:11:59 +02:00
intrinsic.rs rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
misc.rs Remove several unused methods from MiscMethods 2022-10-01 16:45:07 +00:00
mod.rs Add fine-grained LLVM CFI support to the Rust compiler 2022-07-23 10:51:34 -07:00
statics.rs Only compile #[used] as llvm.compiler.used for ELF targets 2022-05-11 01:29:56 -07:00
type_.rs Accept TyCtxt instead of TyCtxtAt in Ty::is_* functions 2022-10-27 15:06:08 +04:00
write.rs Remove unused Context assoc type from WriteBackendMethods 2022-10-01 16:34:45 +00:00