rust/compiler/rustc_codegen_llvm/src
Matthias Krüger 7c3b2e5254
Rollup merge of #140770 - folkertdev:custom-abi, r=tgross35
add `extern "custom"` functions

tracking issue: rust-lang/rust#140829
previous discussion: https://github.com/rust-lang/rust/issues/140566

In short, an `extern "custom"` function is a function with a custom ABI, that rust does not know about. Therefore, such functions can only be defined with `#[unsafe(naked)]` and `naked_asm!`, or via an `extern "C" { /* ... */ }` block. These functions cannot be called using normal rust syntax: calling them can only be done from inline assembly.

The motivation is low-level scenarios where a custom calling convention is used. Currently, we often pick `extern "C"`, but that is a lie because the function does not actually respect the C calling convention.

At the moment `"custom"` seems to be the name with the most support. That name is not final, but we need to pick something to actually implement this.

r? `@traviscross`
cc `@tgross35`

try-job: x86_64-apple-2
2025-06-13 05:19:14 +02:00
..
back Mark all optimize methods and the codegen method as safe 2025-05-28 20:55:00 +00:00
builder add custom enzyme markers to target methods 2025-04-25 11:09:52 +05:30
coverageinfo Remove methods from StaticCodegenMethods that are not called in cg_ssa itself 2025-05-28 20:55:00 +00:00
debuginfo Change tag_field to FieldIdx in Variants::Multiple 2025-06-03 23:42:21 -07:00
llvm get rid of rustc_codegen_ssa::common::AtomicOrdering 2025-05-28 22:57:55 +02:00
abi.rs add extern "custom" functions 2025-06-12 20:27:10 +02:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
asm.rs Add new Tier-3 targets: loongarch32-unknown-none* 2025-06-06 08:19:38 +08:00
attributes.rs use #[naked] for __rust_probestack 2025-06-10 10:08:57 +02:00
base.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
builder.rs Remove type_test from IntrinsicCallBuilderMethods 2025-06-03 10:00:56 +00:00
callee.rs don't depend on rustc_attr_parsing if rustc_data_structures will do 2025-05-09 23:16:55 +02:00
common.rs Rename OperandBundleOwned to OperandBundleBox 2025-05-11 21:21:38 +10:00
consts.rs store target.min_global_align as an Align 2025-06-07 22:06:42 +02:00
context.rs Auto merge of #139385 - joboet:threadlocal_address, r=nikic 2025-05-30 15:39:56 +00:00
declare.rs Make allocator shim creation mostly use safe code 2025-02-24 15:11:29 +00:00
errors.rs -Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to enable retpoline-related target features 2025-06-09 21:29:59 +07:00
intrinsic.rs Remove type_test from IntrinsicCallBuilderMethods 2025-06-03 10:00:56 +00:00
lib.rs Remove all unused feature gates from the compiler 2025-06-08 14:50:42 +00:00
llvm_util.rs -Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to enable retpoline-related target features 2025-06-09 21:29:59 +07:00
mono_item.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
type_.rs remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
type_of.rs rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
va_arg.rs implement va_arg for powerpc 2025-06-01 00:51:01 +02:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00