diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-01-14 12:25:16 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-11 09:47:13 +0000 |
| commit | dcf1e4d72b4dbda592050dcde7d7972414b05d3c (patch) | |
| tree | b56ce5ad454c1692896c3f38db52327ac674b0fc /compiler/rustc_codegen_llvm/src/common.rs | |
| parent | 4b83038d637c1664df94895c82cb8b26716bad1d (diff) | |
| download | rust-dcf1e4d72b4dbda592050dcde7d7972414b05d3c.tar.gz rust-dcf1e4d72b4dbda592050dcde7d7972414b05d3c.zip | |
Document some safety constraints and use more safe wrappers
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/common.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs index 8c94a46ebf3..78b3a7f8541 100644 --- a/compiler/rustc_codegen_llvm/src/common.rs +++ b/compiler/rustc_codegen_llvm/src/common.rs @@ -219,8 +219,8 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { let g = self.define_global(&sym, self.val_ty(sc)).unwrap_or_else(|| { bug!("symbol `{}` is already defined", sym); }); + llvm::set_initializer(g, sc); unsafe { - llvm::LLVMSetInitializer(g, sc); llvm::LLVMSetGlobalConstant(g, True); llvm::LLVMSetUnnamedAddress(g, llvm::UnnamedAddr::Global); } |
