Files
rust/compiler/rustc_codegen_llvm
Guillaume Gomez 0ce1db749b Rollup merge of #161670 - jakos-sec:large-data-threshold, r=nagisa
Pass LargeDataThreshold to LLVM module IR

Before, LargeDataThreshold was only set via `LLVMRustCreateTargetMachine`. When LTO is enabled, this information is required to be passed into the generated LLVM module IR files since the LTO linker spins up its own TargetMachine and otherwise has no knowledge of the LargeDataThreshold.

Currently, `-Z large-data-threshold` has no affect at all when compiling with LTO.
This commit makes sure that if `-Z large-data-threshold` is passed and not 0, it is preserved and stored into the generated LLVM IR.
2026-08-25 00:33:35 +02:00
..
2026-08-21 10:33:58 +02: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.