Files
rust/compiler/rustc_codegen_llvm
Jacob Pratt 0e238fd6c3 Rollup merge of #138618 - nbdd0121:asm_const_ptr, r=bjorn3
Support using const pointers in asm `const` operand

Implements [RFC#3848](https://github.com/rust-lang/rfcs/pull/3848) with tracking issue rust-lang/rust#128464

This adds support of const pointers for asm `const` in addition to plain integers.

The inline `asm!` support is implemented using `i` constraint, and the `global_asm!` and `naked_asm!` support is implemented by inserting `symbol + offset` and make `symbol` compiler-used. For unnamed consts, it will create additional internal & hidden symbols so that they can be referenced by global_asm.

~~The feature is also implemented for GCC backend but it's untested.~~ Tested now.
2026-07-26 00:21:39 -04: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.