about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/consts.rs
AgeCommit message (Collapse)AuthorLines
2025-07-07compiler: Parse `p-` specs in datalayout string, allow definition of custom ↵Edoardo Marangoni-2/+2
default data address space
2025-06-18Merge commit 'fda0bb9588912a3e0606e880ca9f6e913cf8a5a4' into ↵Guillaume Gomez-14/+12
subtree-update_cg_gcc_2025-06-18
2025-06-07store `target.min_global_align` as an `Align`Folkert de Vries-8/+2
2025-05-28Remove methods from StaticCodegenMethods that are not called in cg_ssa itselfbjorn3-8/+3
2025-05-28Remove a couple of uses of interior mutability around staticsbjorn3-3/+3
2025-05-24Cleanup CodegenFnAttrFlagsNoratrieb-1/+1
- Rename `USED` to `USED_COMPILER` to better reflect its behavior. - Reorder some items to group the used and allocator flags together - Renumber them without gaps
2025-05-14Merge commit '6ba33f5e1189a5ae58fb96ce3546e76b13d090f5' into ↵Guillaume Gomez-4/+2
subtree-update_cg_gcc_2025-05-14
2025-04-25Merge commit '4f83a4258deb99f3288a7122c0d5a78200931c61' into ↵Antoni Boucher-4/+4
subtree-update_cg_gcc_2025-04-25
2025-04-04Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkinMatthias Krüger-1/+1
Rename `is_like_osx` to `is_like_darwin` Replace `is_like_osx` with `is_like_darwin`, which more closely describes reality (OS X is the pre-2016 name for macOS, and is by now quite outdated; Darwin is the overall name for the OS underlying Apple's macOS, iOS, etc.). ``@rustbot`` label O-apple r? compiler
2025-03-28Avoid wrapping constant allocations in packed structs when not necessarybjorn3-0/+1
This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.
2025-03-25Rename `is_like_osx` to `is_like_darwin`Mads Marquart-1/+1
2025-02-24Remove an unnecessary lifetimeOli Scherer-3/+3
2025-02-04cg_gcc: Directly use rustc_abi instead of reexportsJubilee Young-1/+1
2025-01-13Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into ↵Antoni Boucher-2/+1
subtree-update_cg_gcc_2025_01_12
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-03Reduce dependence on the target namebjorn3-1/+1
The target name can be anything with custom target specs. Matching on fields inside the target spec is much more robust than matching on the target name.
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-1/+1
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-09-27Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-updateGuillaume Gomez-1/+7
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-17Rename supertraits of `CodegenMethods`.Nicholas Nethercote-2/+4
Supertraits of `BuilderMethods` are all called `XyzBuilderMethods`. Supertraits of `CodegenMethods` are all called `XyzMethods`. This commit changes the latter to `XyzCodegenMethods`, for consistency.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-10Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into masterGuillaume Gomez-41/+53
2024-03-12Make some functions private that are only ever used in the same moduleOli Scherer-1/+1
2024-03-12Check whether a static is mutable instead of passing it downOli Scherer-2/+2
2024-03-05Merge commit 'b385428e3ddf330805241e7758e773f933357c4b' into ↵Guillaume Gomez-60/+83
subtree-update_cg_gcc_2024-03-05
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-2/+3
is immutable
2023-06-19Merge commit '1bbee3e217d75e7bc3bfe5d8c1b35e776fce96e6' into ↵Antoni Boucher-2/+3
sync-cg_gcc-2023-06-19
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-1/+1
2023-05-26Stop creating intermediate places just to immediate convert them to operandsOli Scherer-16/+1
2023-03-05Merge commit '08a6d6e16b5efe217123e780398969946266268f' into ↵Antoni Boucher-85/+86
sync-cg_gcc-2023-03-04
2023-01-25create and use GlobalAlloc::address_spaceErik Desjardins-8/+3
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-4/+12
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
2022-12-05Move linkage type check to HIR analysis and fix semantics issues.Peter Collingbourne-21/+6
This ensures that the error is printed even for unused variables, as well as unifying the handling between the LLVM and GCC backends. This also fixes unusual behavior around exported Rust-defined variables with linkage attributes. With the previous behavior, it appears to be impossible to define such a variable such that it can actually be imported and used by another crate. This is because on the importing side, the variable is required to be a pointer, but on the exporting side, the type checker rejects static variables of pointer type because they do not implement `Sync`. Even if it were possible to import such a type, it appears that code generation on the importing side would add an unexpected additional level of pointer indirection, which would break type safety. This highlighted that the semantics of linkage on Rust-defined variables is different to linkage on foreign items. As such, we now model the difference with two different codegen attributes: linkage for Rust-defined variables, and import_linkage for foreign items. This change gives semantics to the test src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was previously expected to fail to compile. Therefore, convert it into a test that is expected to successfully compile. The update to the GCC backend is speculative and untested.
2022-11-06fix cranelift and gccRalf Jung-2/+2
2022-09-24Add LinkageConstOrMutTypeEllis Hoag-4/+2
2022-08-27interpret: rename relocation → provenanceRalf Jung-6/+6
2022-06-06Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gccAntoni Boucher-12/+13
2022-04-05Use WrappingRange::full instead of hand-rolling itOli Scherer-1/+1
2022-04-05Mark scalar layout unions so that backends that do not support partially ↵Oli Scherer-1/+1
initialized scalars can special case them.
2022-03-26Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into ↵bjorn3-11/+20
sync_cg_gcc-2022-03-26
2022-03-07Introduce `ConstAllocation`.Nicholas Nethercote-3/+4
Currently some `Allocation`s are interned, some are not, and it's very hard to tell at a use point which is which. This commit introduces `ConstAllocation` for the known-interned ones, which makes the division much clearer. `ConstAllocation::inner()` is used to get the underlying `Allocation`. In some places it's natural to use an `Allocation`, in some it's natural to use a `ConstAllocation`, and in some places there's no clear choice. I've tried to make things look as nice as possible, while generally favouring `ConstAllocation`, which is the type that embodies more information. This does require quite a few calls to `inner()`. The commit also tweaks how `PartialOrd` works for `Interned`. The previous code was too clever by half, building on `T: Ord` to make the code shorter. That caused problems with deriving `PartialOrd` and `Ord` for `ConstAllocation`, so I changed it to build on `T: PartialOrd`, which is slightly more verbose but much more standard and avoided the problems.
2022-02-06`#[used(linker)]` attribute (https://github.com/dtolnay/linkme/issues/41)cynecx-1/+1
2021-12-31Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into ↵bjorn3-7/+11
sync_cg_clif-2021-12-31
2021-09-28Merge commit '9809f5d21990d9e24b3e9876ea7da756fd4e9def' into libgccjit-codegenAntoni Boucher-67/+22
2021-09-17Merge commit '48d60ab7c505c6c1ebb042eacaafd8dc9f7a9267' into libgccjit-codegenAntoni Boucher-3/+8
2021-08-15Merge commit 'e228f0c16ea8c34794a6285bf57aab627c26b147' into libgccjit-codegenAntoni Boucher-117/+20
2021-08-12Add 'compiler/rustc_codegen_gcc/' from commit ↵Antoni Boucher-0/+527
'afae271d5d3719eeb92c18bc004bb6d1965a5f3f' git-subtree-dir: compiler/rustc_codegen_gcc git-subtree-mainline: ae90dcf0207c57c3034f00b07048d63f8b2363c8 git-subtree-split: afae271d5d3719eeb92c18bc004bb6d1965a5f3f