diff options
| author | bors <bors@rust-lang.org> | 2024-07-16 16:14:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-16 16:14:47 +0000 |
| commit | 16b569057e4d1591b4bee05f10df34000308dedc (patch) | |
| tree | 91e0788419dd4b30c1b21dfce0c11503c0d88ac4 /compiler/rustc_codegen_llvm/src/back/lto.rs | |
| parent | a91f7d72f12efcc00ecf71591f066c534d45ddf7 (diff) | |
| parent | ab4cc440dd4711fbdba04417aa43910d95576c13 (diff) | |
| download | rust-16b569057e4d1591b4bee05f10df34000308dedc.tar.gz rust-16b569057e4d1591b4bee05f10df34000308dedc.zip | |
Auto merge of #127819 - matthiaskrgr:rollup-djdffkl, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #127669 (Fix the issue of invalid suggestion for a reference of iterator) - #127707 (match lowering: Use an iterator to find `expand_until`) - #127730 (Fix and enforce `unsafe_op_in_unsafe_fn` in compiler) - #127789 (delete #![allow(unsafe_op_in_unsafe_fn)] in teeos) - #127805 (run-make-support: update gimli to 0.31.0) - #127808 (Make ErrorGuaranteed discoverable outside types, consts, and lifetimes) - #127817 (Fix a bunch of sites that were walking instead of visiting, making it impossible for visitor impls to look at these values) - #127818 (Various ast validation simplifications) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/lto.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/lto.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index aff3e3d7076..aef672631c8 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -727,7 +727,7 @@ pub unsafe fn optimize_thin_module( // into that context. One day, however, we may do this for upstream // crates but for locally codegened modules we may be able to reuse // that LLVM Context and Module. - let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names); + let llcx = unsafe { llvm::LLVMRustContextCreate(cgcx.fewer_names) }; let llmod_raw = parse_module(llcx, module_name, thin_module.data(), dcx)? as *const _; let mut module = ModuleCodegen { module_llvm: ModuleLlvm { llmod_raw, llcx, tm: ManuallyDrop::new(tm) }, @@ -750,7 +750,9 @@ pub unsafe fn optimize_thin_module( { let _timer = cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_rename", thin_module.name()); - if !llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) { + if unsafe { + !llvm::LLVMRustPrepareThinLTORename(thin_module.shared.data.0, llmod, target) + } { return Err(write::llvm_err(dcx, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-rename"); @@ -760,7 +762,8 @@ pub unsafe fn optimize_thin_module( let _timer = cgcx .prof .generic_activity_with_arg("LLVM_thin_lto_resolve_weak", thin_module.name()); - if !llvm::LLVMRustPrepareThinLTOResolveWeak(thin_module.shared.data.0, llmod) { + if unsafe { !llvm::LLVMRustPrepareThinLTOResolveWeak(thin_module.shared.data.0, llmod) } + { return Err(write::llvm_err(dcx, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-resolve"); @@ -770,7 +773,8 @@ pub unsafe fn optimize_thin_module( let _timer = cgcx .prof .generic_activity_with_arg("LLVM_thin_lto_internalize", thin_module.name()); - if !llvm::LLVMRustPrepareThinLTOInternalize(thin_module.shared.data.0, llmod) { + if unsafe { !llvm::LLVMRustPrepareThinLTOInternalize(thin_module.shared.data.0, llmod) } + { return Err(write::llvm_err(dcx, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-internalize"); @@ -779,7 +783,9 @@ pub unsafe fn optimize_thin_module( { let _timer = cgcx.prof.generic_activity_with_arg("LLVM_thin_lto_import", thin_module.name()); - if !llvm::LLVMRustPrepareThinLTOImport(thin_module.shared.data.0, llmod, target) { + if unsafe { + !llvm::LLVMRustPrepareThinLTOImport(thin_module.shared.data.0, llmod, target) + } { return Err(write::llvm_err(dcx, LlvmError::PrepareThinLtoModule)); } save_temp_bitcode(cgcx, &module, "thin-lto-after-import"); |
