rust/compiler/rustc_codegen_llvm/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 Support raw-dylib functions being used inside inlined functions 2022-10-24 16:17:38 -07:00
coverageinfo more dupe word typos 2022-10-14 12:57:56 +08:00
debuginfo Change name of "dataful" variant to "untagged" 2022-09-07 20:12:45 +00:00
llvm Use the existing set_visibility function. 2022-09-28 14:43:58 -07: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
asm.rs Add links to relevant pages to find constraint information 2022-10-13 22:05:49 +02:00
attributes.rs Add inline-llvm option for disabling/enabling LLVM inlining 2022-09-09 08:00:47 -07:00
base.rs Remove several unused methods from MiscMethods 2022-10-01 16:45:07 +00:00
builder.rs Don't use usub.with.overflow intrinsic 2022-10-20 12:47:17 +02:00
callee.rs Get rid of native_library projection queries 2022-10-19 16:21:21 +02:00
common.rs Introduce a fallible variant of LLVMConstIntGetZExtValue 2022-09-09 15:54:14 +02:00
consts.rs Get rid of native_library projection queries 2022-10-19 16:21:21 +02:00
context.rs Remove several unused methods from MiscMethods 2022-10-01 16:45:07 +00:00
declare.rs Change declare_cfn to use the C visibility for all C ABI functions. 2022-09-28 14:50:58 -07:00
intrinsic.rs Merge apply_attrs_callsite into call and invoke 2022-10-01 17:01:31 +00:00
lib.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
llvm_util.rs Remove support for LLVM's legacy pass manager 2022-09-18 13:25:49 -07:00
mono_item.rs Always import all tracing macros for the entire crate instead of piecemeal by module 2022-09-01 14:54:27 +00:00
type_.rs Add fine-grained LLVM CFI support to the Rust compiler 2022-07-23 10:51:34 -07:00
type_of.rs Always import all tracing macros for the entire crate instead of piecemeal by module 2022-09-01 14:54:27 +00:00
va_arg.rs Introduce Bx::switch_to_block 2022-02-24 12:18:21 +01:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00