rust/compiler/rustc_codegen_gcc/src
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
..
back simplify a self-profiling activity call in the cg_gcc backend 2022-04-07 15:47:20 +02:00
intrinsic Merge apply_attrs_callsite into call and invoke 2022-10-01 17:01:31 +00:00
abi.rs Merge apply_attrs_callsite into call and invoke 2022-10-01 17:01:31 +00:00
allocator.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
archive.rs Support raw-dylib functions being used inside inlined functions 2022-10-24 16:17:38 -07:00
asm.rs Merge apply_attrs_callsite into call and invoke 2022-10-01 17:01:31 +00:00
base.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
builder.rs Remove type argument of array_alloca and rename to byte_array_alloca 2022-10-02 13:42:14 +00:00
callee.rs Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
common.rs Remove dead broken code from const zst handling in backends 2022-09-06 14:09:49 +00:00
consts.rs Add LinkageConstOrMutType 2022-09-24 10:24:48 -07:00
context.rs Remove several unused methods from MiscMethods 2022-10-01 16:45:07 +00:00
coverageinfo.rs Merge commit 'e228f0c16ea8c34794a6285bf57aab627c26b147' into libgccjit-codegen 2021-08-15 08:29:07 -04: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 Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc 2022-06-06 22:04:37 -04:00
errors.rs Migrate all diagnostics 2022-10-23 10:09:44 +02:00
int.rs Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc 2022-06-06 22:04:37 -04:00
lib.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
mono_item.rs Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
type_.rs Add fine-grained LLVM CFI support to the Rust compiler 2022-07-23 10:51:34 -07:00
type_of.rs Update TypeVisitor paths 2022-07-06 06:41:53 +01:00