rust/compiler/rustc_codegen_llvm
Stuart Cook aa2dcbe583
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`.
2025-08-18 15:31:12 +10:00
..

The codegen crate contains the code to convert from MIR into LLVM IR, and then from LLVM IR into machine code. In general it contains code that runs towards the end of the compilation process.

For more information about how codegen works, see the rustc dev guide.