about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/consts.rs
AgeCommit message (Collapse)AuthorLines
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