diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-12 06:07:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 06:07:35 +0100 |
| commit | 9e89feefb9ce0309cc7fdba91b4e42c4bfe7bbb8 (patch) | |
| tree | 5a95a808bb78c41fc231c0676b751bf4013f49e0 /compiler/rustc_codegen_llvm/src/allocator.rs | |
| parent | 34a5ea911c56e79bd451c63f04ea2f5023d7d1a3 (diff) | |
| parent | dcf1e4d72b4dbda592050dcde7d7972414b05d3c (diff) | |
| download | rust-9e89feefb9ce0309cc7fdba91b4e42c4bfe7bbb8.tar.gz rust-9e89feefb9ce0309cc7fdba91b4e42c4bfe7bbb8.zip | |
Rollup merge of #135549 - oli-obk:push-tmxtpnrloyqu, r=compiler-errors
Document some safety constraints and use more safe wrappers Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/allocator.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/allocator.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/allocator.rs b/compiler/rustc_codegen_llvm/src/allocator.rs index 149ded28356..66723cbf882 100644 --- a/compiler/rustc_codegen_llvm/src/allocator.rs +++ b/compiler/rustc_codegen_llvm/src/allocator.rs @@ -81,13 +81,13 @@ pub(crate) unsafe fn codegen( llvm::set_visibility(ll_g, llvm::Visibility::from_generic(tcx.sess.default_visibility())); let val = tcx.sess.opts.unstable_opts.oom.should_panic(); let llval = llvm::LLVMConstInt(i8, val as u64, False); - llvm::LLVMSetInitializer(ll_g, llval); + llvm::set_initializer(ll_g, llval); let name = NO_ALLOC_SHIM_IS_UNSTABLE; let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_c_char_ptr(), name.len(), i8); llvm::set_visibility(ll_g, llvm::Visibility::from_generic(tcx.sess.default_visibility())); let llval = llvm::LLVMConstInt(i8, 0, False); - llvm::LLVMSetInitializer(ll_g, llval); + llvm::set_initializer(ll_g, llval); } if tcx.sess.opts.debuginfo != DebugInfo::None { |
