diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-08-18 15:31:12 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-18 15:31:12 +1000 |
| commit | aa2dcbe583037bdd13e0f1f5bcf5933d589481a8 (patch) | |
| tree | caa06d44b4c9bff716ab22f1185cb35cdcbb9ae3 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 3a694c7595a5a1cae6277e7a9245a6e7165b6bee (diff) | |
| parent | e193b5342b170f9e3cc6e7ee3bd863652f1244a2 (diff) | |
| download | rust-aa2dcbe583037bdd13e0f1f5bcf5933d589481a8.tar.gz rust-aa2dcbe583037bdd13e0f1f5bcf5933d589481a8.zip | |
Rollup merge of #145420 - Zalathar:llvm-c, r=WaffleLapkin
cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind` This PR replaces two existing `LLVMRust` bindings with equivalent calls to the LLVM-C API. For `LLVMGetTypeKind`, we avoid the UB hazard by declaring the foreign function to return `RawEnum<TypeKind>` (which is a wrapper around `u32`), and then perform checked conversion from `u32` to `TypeKind`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index cb98df59c1b..427c75d40e9 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -1453,7 +1453,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { instance: Option<Instance<'tcx>>, ) { let call = self.call(llty, fn_attrs, Some(fn_abi), llfn, args, funclet, instance); - llvm::LLVMRustSetTailCallKind(call, llvm::TailCallKind::MustTail); + llvm::LLVMSetTailCallKind(call, llvm::TailCallKind::MustTail); match &fn_abi.ret.mode { PassMode::Ignore | PassMode::Indirect { .. } => self.ret_void(), |
