diff options
| author | Luv-Ray <zhuoxun.yang777@outlook.com> | 2024-09-19 09:39:28 +0800 |
|---|---|---|
| committer | Luv-Ray <zhuoxun.yang777@outlook.com> | 2024-09-19 09:39:28 +0800 |
| commit | b7c5656713158e826189db21eeea051347548e07 (patch) | |
| tree | 79959f337e65a2b9d8814baefac0640289724a77 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | a5cf8bbd4e1c8edeae08778c85c6f806dd00e853 (diff) | |
| download | rust-b7c5656713158e826189db21eeea051347548e07.tar.gz rust-b7c5656713158e826189db21eeea051347548e07.zip | |
replace some deprecated functions
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index d231b103964..89f4c4cf179 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1545,20 +1545,16 @@ pub(crate) fn apply_vcall_visibility_metadata<'ll, 'tcx>( let trait_ref_typeid = typeid_for_trait_ref(cx.tcx, trait_ref); unsafe { - let typeid = llvm::LLVMMDStringInContext( + let typeid = llvm::LLVMMDStringInContext2( cx.llcx, trait_ref_typeid.as_ptr() as *const c_char, - trait_ref_typeid.as_bytes().len() as c_uint, + trait_ref_typeid.as_bytes().len(), ); - let v = [cx.const_usize(0), typeid]; + let v = [llvm::LLVMValueAsMetadata(cx.const_usize(0)), typeid]; llvm::LLVMRustGlobalAddMetadata( vtable, llvm::MD_type as c_uint, - llvm::LLVMValueAsMetadata(llvm::LLVMMDNodeInContext( - cx.llcx, - v.as_ptr(), - v.len() as c_uint, - )), + llvm::LLVMMDNodeInContext2(cx.llcx, v.as_ptr(), v.len()), ); let vcall_visibility = llvm::LLVMValueAsMetadata(cx.const_u64(vcall_visibility as u64)); let vcall_visibility_metadata = llvm::LLVMMDNodeInContext2(cx.llcx, &vcall_visibility, 1); |
