diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-09 09:48:46 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-14 08:27:08 +0000 |
| commit | 7f95f042677f86df55da58cdebe9ce31a1e928a8 (patch) | |
| tree | 41017783d171c58ae47eed3328f17b545fe6342d /compiler/rustc_codegen_llvm/src/context.rs | |
| parent | 56d22cd29ff6d3ea1fa8972462ad94792960b1ef (diff) | |
| download | rust-7f95f042677f86df55da58cdebe9ce31a1e928a8.tar.gz rust-7f95f042677f86df55da58cdebe9ce31a1e928a8.zip | |
Eliminate all direct uses of LLVMMDStringInContext2
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 51ba3fb8089..6a23becaa96 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -475,7 +475,7 @@ pub(crate) unsafe fn create_module<'ll>( let rustc_producer = format!("rustc version {}", option_env!("CFG_VERSION").expect("CFG_VERSION")); - let name_metadata = cx.create_metadata(rustc_producer); + let name_metadata = cx.create_metadata(rustc_producer.as_bytes()); unsafe { llvm::LLVMAddNamedMetadataOperand( @@ -695,7 +695,7 @@ impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX> { } } - pub(crate) fn create_metadata(&self, name: String) -> &'ll Metadata { + pub(crate) fn create_metadata(&self, name: &[u8]) -> &'ll Metadata { unsafe { llvm::LLVMMDStringInContext2(self.llcx(), name.as_ptr() as *const c_char, name.len()) } |
