diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-16 21:36:45 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-16 21:36:45 +1000 |
| commit | 79c9f6ee9b3229279ffdaa0515c7b0320c0b0737 (patch) | |
| tree | eec1031a8463540fbe756b469ffd35897322d695 /compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs | |
| parent | 9d82de19dfae60e55c291f5f28e28cfc2c1b9630 (diff) | |
| download | rust-79c9f6ee9b3229279ffdaa0515c7b0320c0b0737.tar.gz rust-79c9f6ee9b3229279ffdaa0515c7b0320c0b0737.zip | |
Stop using `as_c_char_ptr` for coverage-related bindings
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs index bc4f6bb6a82..2aa3dec8131 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/llvm_cov.rs @@ -2,7 +2,6 @@ use std::ffi::CString; -use crate::common::AsCCharPtr; use crate::coverageinfo::ffi; use crate::llvm; @@ -34,7 +33,7 @@ pub(crate) fn create_pgo_func_name_var<'ll>( unsafe { llvm::LLVMRustCoverageCreatePGOFuncNameVar( llfn, - mangled_fn_name.as_c_char_ptr(), + mangled_fn_name.as_ptr(), mangled_fn_name.len(), ) } @@ -44,7 +43,7 @@ pub(crate) fn write_filenames_to_buffer(filenames: &[impl AsRef<str>]) -> Vec<u8 let (pointers, lengths) = filenames .into_iter() .map(AsRef::as_ref) - .map(|s: &str| (s.as_c_char_ptr(), s.len())) + .map(|s: &str| (s.as_ptr(), s.len())) .unzip::<_, _, Vec<_>, Vec<_>>(); llvm::build_byte_buffer(|buffer| unsafe { @@ -89,7 +88,7 @@ pub(crate) fn write_function_mappings_to_buffer( /// Hashes some bytes into a 64-bit hash, via LLVM's `IndexedInstrProf::ComputeHash`, /// as required for parts of the LLVM coverage mapping format. pub(crate) fn hash_bytes(bytes: &[u8]) -> u64 { - unsafe { llvm::LLVMRustCoverageHashBytes(bytes.as_c_char_ptr(), bytes.len()) } + unsafe { llvm::LLVMRustCoverageHashBytes(bytes.as_ptr(), bytes.len()) } } /// Returns LLVM's `coverage::CovMapVersion::CurrentVersion` (CoverageMapping.h) |
