rust/compiler/rustc_codegen_gcc/src
Matthias Krüger 1e454fe725
Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk
Separate Builder methods from tcx

As part of the autodiff upstreaming we noticed, that it would be nice to have various builder methods available without the TypeContext, which prevents the normal CodegenCx to be passed around between threads.
We introduce a SimpleCx which just owns the llvm module and llvm context, to encapsulate them.
The previous CodegenCx now implements deref and forwards access to the llvm module or context to it's SimpleCx sub-struct. This gives us a bit more flexibility, because now we can pass (or construct) the SimpleCx in locations where we don't have enough information to construct a CodegenCx, or are not able to pass it around due to the tcx lifetimes (and it not implementing send/sync).

This also introduces an SBuilder, similar to the SimpleCx. The SBuilder uses a SimpleCx, whereas the existing Builder uses the larger CodegenCx. I will push updates to make  implementations generic (where possible) to be implemented once and work for either of the two. I'll also clean up the leftover code.

`call` is a bit tricky, because it requires a tcx, I probably need to duplicate it after all.

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-01-24 23:25:42 +01:00
..
back Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
intrinsic Use a C-safe return type for __rust_[ui]128_* overflowing intrinsics 2025-01-15 03:49:39 +00:00
abi.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
allocator.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
asm.rs codegen #[naked] functions using global_asm! 2024-12-10 21:41:03 +01:00
attributes.rs mir_transform: implement forced inlining 2025-01-10 18:37:54 +00:00
base.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
builder.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
callee.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
common.rs Treat undef bytes as equal to any other byte 2025-01-21 08:27:21 +00:00
consts.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
context.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
coverageinfo.rs Unbox and unwrap the contents of StatementKind::Coverage 2024-03-23 22:05:11 +11:00
debuginfo.rs When LLVM's location discriminator value limit is exceeded, emit locations with dummy spans instead of dropping them entirely 2025-01-19 07:17:33 -08:00
declare.rs Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-update 2024-09-27 22:00:17 +02:00
errors.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
gcc_util.rs Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
int.rs Use a C-safe return type for __rust_[ui]128_* overflowing intrinsics 2025-01-15 03:49:39 +00:00
lib.rs Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk 2025-01-24 23:25:42 +01:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs Rename supertraits of CodegenMethods. 2024-09-17 10:24:43 +10:00
type_of.rs cg_gcc: rustc_abi::Abi => BackendRepr 2024-10-29 15:01:01 -07:00