rust/compiler/rustc_codegen_llvm/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 rustc_codegen_llvm: remove outdated asm-to-obj codegen note 2025-01-22 17:58:50 -05:00
builder Make CodegenCx and Builder generic 2025-01-24 16:05:26 -05:00
coverageinfo coverage: Make query coverage_ids_info return an Option 2025-01-24 16:13:11 +11:00
debuginfo Auto merge of #135643 - khuey:135332, r=jieyouxu 2025-01-20 14:16:22 +00:00
llvm Rollup merge of #135156 - Zalathar:debuginfo-flags, r=cuviper 2025-01-22 19:29:39 +01:00
abi.rs Add gpu-kernel calling convention 2025-01-16 00:26:55 +01:00
allocator.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
asm.rs Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errors 2024-12-12 02:34:06 +00:00
attributes.rs Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubilee 2025-01-11 18:13:45 +01:00
base.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
builder.rs Make CodegenCx and Builder generic 2025-01-24 16:05:26 -05:00
callee.rs rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
common.rs Treat undef bytes as equal to any other byte 2025-01-21 08:27:21 +00:00
consts.rs Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
context.rs Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk 2025-01-24 23:25:42 +01:00
declare.rs Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk 2025-01-24 23:25:42 +01:00
errors.rs Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
intrinsic.rs Make CodegenCx and Builder generic 2025-01-24 16:05:26 -05:00
lib.rs Make CodegenCx and Builder generic 2025-01-24 16:05:26 -05:00
llvm_util.rs Rollup merge of #131830 - hoodmane:emscripten-wasm-eh, r=workingjubilee 2025-01-06 22:04:13 -05:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs Make CodegenCx and Builder generic 2025-01-24 16:05:26 -05:00
type_of.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
va_arg.rs Teach rust core about Xtensa VaListImpl and add a custom lowering of vaarg for xtensa. 2024-12-03 10:54:08 +00:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00