about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-09-28Add a leading dash to linker plugin arguments in the gcc codegenAntoni Boucher-0/+4
2025-06-22cranelift: fix target feature name type: "fxsr"Martin Liska-1/+1
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-3/+2
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-06-03Only borrow EncodedMetadata in codegen_cratebjorn3-7/+2
And move passing it to the linker to the driver code.
2025-05-25Merge commit '979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785' into ↵bjorn3-6/+37
sync_cg_clif-2025-05-25
2025-04-27Implement the internal feature `cfg_target_has_reliable_f16_f128`Trevor Gross-3/+12
Support for `f16` and `f128` is varied across targets, backends, and backend versions. Eventually we would like to reach a point where all backends support these approximately equally, but until then we have to work around some of these nuances of support being observable. Introduce the `cfg_target_has_reliable_f16_f128` internal feature, which provides the following new configuration gates: * `cfg(target_has_reliable_f16)` * `cfg(target_has_reliable_f16_math)` * `cfg(target_has_reliable_f128)` * `cfg(target_has_reliable_f128_math)` `reliable_f16` and `reliable_f128` indicate that basic arithmetic for the type works correctly. The `_math` versions indicate that anything relying on `libm` works correctly, since sometimes this hits a separate class of codegen bugs. These options match configuration set by the build script at [1]. The logic for LLVM support is duplicated as-is from the same script. There are a few possible updates that will come as a follow up. The config introduced here is not planned to ever become stable, it is only intended to replace the build scripts for `std` tests and `compiler-builtins` that don't have any way to configure based on the codegen backend. MCP: https://github.com/rust-lang/compiler-team/issues/866 Closes: https://github.com/rust-lang/compiler-team/issues/866 [1]: https://github.com/rust-lang/rust/blob/555e1d0386f024a8359645c3217f4b3eae9be042/library/std/build.rs#L84-L186
2025-04-07Prepend temp files with a string per invocation of rustcMichael Goulet-0/+2
2025-03-30Merge commit 'ba315abda789c9f59f2100102232bddb30b0d3d3' into ↵bjorn3-15/+11
sync_cg_clif-2025-03-30
2025-03-17Remove implicit #[no_mangle] for #[rustc_std_internal_symbol]bjorn3-0/+1
2025-03-05Change signature of `target_features_cfg`.Nicholas Nethercote-7/+6
Currently it is called twice, once with `allow_unstable` set to true and once with it set to false. This results in some duplicated work. Most notably, for the LLVM backend, `LLVMRustHasFeature` is called twice for every feature, and it's moderately slow. For very short running compilations on platforms with many features (e.g. a `check` build of hello-world on x86) this is a significant fraction of runtime. This commit changes `target_features_cfg` so it is only called once, and it now returns a pair of feature sets. This halves the number of `LLVMRustHasFeature` calls.
2025-02-13Make `-O` mean `-C opt-level=3`clubby789-1/+1
2025-02-07Merge commit '8332329f83d4ef34479fec67cc21b21246dca6b5' into ↵bjorn3-3/+2
sync_cg_clif-2025-02-07
2025-01-05Merge commit '918acafef682d0d0ca30b47de4768210417ff362' into ↵bjorn3-0/+3
sync_cg_clif-2025-01-05
2024-12-14Rollup merge of #134251 - bjorn3:various_cleanups2, r=oli-obkMatthias Krüger-1/+0
A bunch of cleanups (part 2) Just like https://github.com/rust-lang/rust/pull/133567 these were all found while looking at the respective code, but are not blocking any other changes I want to make in the short term.
2024-12-13Remove jobserver from Sessionbjorn3-1/+0
It is effectively a global resource and the jobserver::Client in Session was a clone of GLOBAL_CLIENT anyway.
2024-12-11generalize 'forbidden feature' concept so that even (un)stable feature can ↵Ralf Jung-1/+5
be invalid to toggle Also rename some things for extra clarity
2024-12-06Move some timers aroundbjorn3-2/+0
2024-12-06Merge commit '57845a397ec15e4e6a561ed2c4bfa3dcf49144fb' into ↵bjorn3-25/+34
sync_cg_clif-2024-12-06
2024-11-28Replace `Symbol::intern` calls with preinterned symbolsclubby789-7/+2
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-1/+1
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-09Add a default implementation for CodegenBackend::linkbjorn3-13/+0
As a side effect this should add raw-dylib support to cg_gcc as the default ArchiveBuilderBuilder that is used implements create_dll_import_lib. I haven't tested if the raw-dylib support actually works however.
2024-11-09Merge commit '1fa693ca4462fc1f790693464cf765ad693616af' into ↵bjorn3-0/+2
sync_cg_clif-2024-11-09
2024-11-02Merge commit '5b1246bb4bed72fd0bb8fa497d8e5ed2c7f3515c' into ↵bjorn3-2/+5
sync_cg_clif-2024-11-02
2024-11-01Move versioned LLVM target creation to rustc_codegen_ssaMads Marquart-1/+4
The OS version depends on the deployment target environment variables, the access of which we want to move to later in the compilation pipeline that has access to more information, for example `env_depinfo`.
2024-10-29cg_clif: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-1/+1
2024-10-08cg_clif: Factor out rustc_target::abiJubilee Young-0/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-7/+7
2024-08-17Always use ar_archive_writer for import libsChris Denton-1/+0
2024-08-09Use ar_archive_writer from sysroot for cg_clifbjorn3-0/+1
2024-08-09Merge commit '69b3f5a426a5c1c05236a45b36f6679d95fbe01b' into ↵bjorn3-3/+14
sync_cg_clif-2024-08-09
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-15Move compiler_builtin check to the use caseMohammad Omidvar-1/+0
2024-06-30Merge commit '49cd5dd454d0115cfbe9e39102a8b3ba4616aa40' into ↵bjorn3-12/+8
sync_cg_clif-2024-06-30
2024-06-23cg_clif: Define build opts from FramePointerJubilee Young-3/+3
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-1/+1
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-4/+7
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-05-13Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into ↵bjorn3-3/+3
sync_cg_clif-2024-05-13
2024-05-09Make builtin_deref just return a TyMichael Goulet-1/+1
2024-04-23Merge commit 'de5d6523738fd44a0521b6abf3e73ae1df210741' into ↵bjorn3-8/+4
sync_cg_clif-2024-04-23
2024-03-28Merge commit '09fae60a86b848a2fc0ad219ecc4e438dc1eef86' into ↵bjorn3-6/+7
sync_cg_clif-2024-03-28
2024-03-16Handle calls to upstream monomorphizations in compiler_builtinsBen Kimock-0/+1
2024-02-17Make `CodegenBackend::join_codegen` infallible.Nicholas Nethercote-3/+3
Because they all are, in practice.
2024-02-06Invert diagnostic lints.Nicholas Nethercote-0/+2
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-26Merge commit '3e50cf65025f96854d6597e80449b0d64ad89589' into ↵bjorn3-9/+14
sync_cg_clif-2024-01-26
2023-12-24Remove more `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-8/+11
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-22update cfg(bootstrap)sPietro Albini-3/+3
2023-10-21Merge commit 'c07d1e2f88cb3b1a0604ae8f18b478c1aeb7a7fa' into ↵bjorn3-4/+4
sync_cg_clif-2023-10-21
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+3
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-09Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into ↵bjorn3-22/+17
sync_cg_clif-2023-10-09