1
Fork 0

Merge commit '49cd5dd454' into sync_cg_clif-2024-06-30

This commit is contained in:
bjorn3 2024-06-30 11:28:14 +00:00
commit 9ec6a02ab3
23 changed files with 441 additions and 292 deletions

View file

@ -11,15 +11,10 @@ use rustc_session::config::OomStrategy;
use crate::prelude::*;
/// Returns whether an allocator shim was created
pub(crate) fn codegen(
tcx: TyCtxt<'_>,
module: &mut impl Module,
unwind_context: &mut UnwindContext,
) -> bool {
pub(crate) fn codegen(tcx: TyCtxt<'_>, module: &mut dyn Module) -> bool {
let Some(kind) = allocator_kind_for_codegen(tcx) else { return false };
codegen_inner(
module,
unwind_context,
kind,
tcx.alloc_error_handler_kind(()).unwrap(),
tcx.sess.opts.unstable_opts.oom,
@ -28,8 +23,7 @@ pub(crate) fn codegen(
}
fn codegen_inner(
module: &mut impl Module,
unwind_context: &mut UnwindContext,
module: &mut dyn Module,
kind: AllocatorKind,
alloc_error_handler_kind: AllocatorKind,
oom_strategy: OomStrategy,
@ -67,7 +61,6 @@ fn codegen_inner(
};
crate::common::create_wrapper_function(
module,
unwind_context,
sig,
&global_fn_name(method.name),
&default_fn_name(method.name),
@ -82,7 +75,6 @@ fn codegen_inner(
};
crate::common::create_wrapper_function(
module,
unwind_context,
sig,
"__rust_alloc_error_handler",
&alloc_error_handler_name(alloc_error_handler_kind),