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/asm.rs | |
| parent | a5cf8bbd4e1c8edeae08778c85c6f806dd00e853 (diff) | |
| download | rust-b7c5656713158e826189db21eeea051347548e07.tar.gz rust-b7c5656713158e826189db21eeea051347548e07.zip | |
replace some deprecated functions
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/asm.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/asm.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs index 775266fec97..4afbdbabdc8 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs @@ -504,10 +504,15 @@ pub(crate) fn inline_asm_call<'ll>( // due to the asm template string coming from a macro. LLVM will // default to the first srcloc for lines that don't have an // associated srcloc. - srcloc.push(bx.const_i32(0)); + srcloc.push(llvm::LLVMValueAsMetadata(bx.const_i32(0))); } - srcloc.extend(line_spans.iter().map(|span| bx.const_i32(span.lo().to_u32() as i32))); - let md = llvm::LLVMMDNodeInContext(bx.llcx, srcloc.as_ptr(), srcloc.len() as u32); + srcloc.extend( + line_spans + .iter() + .map(|span| llvm::LLVMValueAsMetadata(bx.const_i32(span.lo().to_u32() as i32))), + ); + let md = llvm::LLVMMDNodeInContext2(bx.llcx, srcloc.as_ptr(), srcloc.len()); + let md = llvm::LLVMMetadataAsValue(&bx.llcx, md); llvm::LLVMSetMetadata(call, kind, md); Some(call) |
