diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-09 09:36:19 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-14 08:27:08 +0000 |
| commit | 56d22cd29ff6d3ea1fa8972462ad94792960b1ef (patch) | |
| tree | d092f80caf8ffd5e343612e09b19903a62fa3978 /compiler/rustc_codegen_llvm/src/consts.rs | |
| parent | b9baf63f99bbdf69571e26fca907af032c416591 (diff) | |
| download | rust-56d22cd29ff6d3ea1fa8972462ad94792960b1ef.tar.gz rust-56d22cd29ff6d3ea1fa8972462ad94792960b1ef.zip | |
Use context methods instead of directly calling FFI
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/consts.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/consts.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index 27f6a119727..40e686b253c 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -477,13 +477,7 @@ impl<'ll> CodegenCx<'ll, '_> { .unwrap_or(true) { if let Some(section) = attrs.link_section { - let section = unsafe { - llvm::LLVMMDStringInContext2( - self.llcx, - section.as_str().as_c_char_ptr(), - section.as_str().len(), - ) - }; + let section = self.create_metadata(section.as_str().into()); assert!(alloc.provenance().ptrs().is_empty()); // The `inspect` method is okay here because we checked for provenance, and |
