diff options
| author | bors <bors@rust-lang.org> | 2022-11-01 09:01:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-01 09:01:12 +0000 |
| commit | c493bae0d8efd75723460ce5c371f726efa93f15 (patch) | |
| tree | 2ea0e17fd499adaa1c6d2e150edfeb0bf35baad8 /compiler/rustc_codegen_llvm/src | |
| parent | dc05f60c1ff4e2cb2e6eb80c9b3afa612ce28c7f (diff) | |
| parent | 5d30bfc43124e9c907851a5f36ab4afd48b3578d (diff) | |
| download | rust-c493bae0d8efd75723460ce5c371f726efa93f15.tar.gz rust-c493bae0d8efd75723460ce5c371f726efa93f15.zip | |
Auto merge of #103832 - Dylan-DPC:rollup-maw3kmx, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #103061 (Rewrite implementation of `#[alloc_error_handler]`) - #103584 (Remove bounds check when array is indexed by enum) - #103706 (Fix E0433 No Typo Suggestions) - #103729 (interpret: fix align_of_val on packed types) - #103759 (Use `adt_def` during type collection.) - #103809 (Fix a typo in std::net mod doc comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/allocator.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/allocator.rs b/compiler/rustc_codegen_llvm/src/allocator.rs index 72961ae888e..fed56cdd438 100644 --- a/compiler/rustc_codegen_llvm/src/allocator.rs +++ b/compiler/rustc_codegen_llvm/src/allocator.rs @@ -15,7 +15,7 @@ pub(crate) unsafe fn codegen( module_llvm: &mut ModuleLlvm, module_name: &str, kind: AllocatorKind, - has_alloc_error_handler: bool, + alloc_error_handler_kind: AllocatorKind, ) { let llcx = &*module_llvm.llcx; let llmod = module_llvm.llmod(); @@ -117,8 +117,7 @@ pub(crate) unsafe fn codegen( attributes::apply_to_llfn(llfn, llvm::AttributePlace::Function, &[uwtable]); } - let kind = if has_alloc_error_handler { AllocatorKind::Global } else { AllocatorKind::Default }; - let callee = kind.fn_name(sym::oom); + let callee = alloc_error_handler_kind.fn_name(sym::oom); let callee = llvm::LLVMRustGetOrInsertFunction(llmod, callee.as_ptr().cast(), callee.len(), ty); // -> ! DIFlagNoReturn attributes::apply_to_llfn(callee, llvm::AttributePlace::Function, &[no_return]); diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 89c7e51d09e..d51aced85df 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -108,11 +108,11 @@ impl ExtraBackendMethods for LlvmCodegenBackend { tcx: TyCtxt<'tcx>, module_name: &str, kind: AllocatorKind, - has_alloc_error_handler: bool, + alloc_error_handler_kind: AllocatorKind, ) -> ModuleLlvm { let mut module_llvm = ModuleLlvm::new_metadata(tcx, module_name); unsafe { - allocator::codegen(tcx, &mut module_llvm, module_name, kind, has_alloc_error_handler); + allocator::codegen(tcx, &mut module_llvm, module_name, kind, alloc_error_handler_kind); } module_llvm } |
