about summary refs log tree commit diff
path: root/compiler/rustc_target/src/abi
AgeCommit message (Collapse)AuthorLines
2023-02-15Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8KiDylan DPC-46/+2
Remove some superfluous type parameters from layout.rs. Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-5/+5
...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.
2023-01-22rustc_abi: remove Primitive::{is_float,is_int}Erik Desjardins-3/+3
there were fixmes for this already i am about to remove is_ptr (since callers need to properly distinguish between pointers in different address spaces), so might as well do this at the same time
2023-01-21Remove some superfluous type parameters from layout.rs.Michael Benfield-46/+2
Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-01-06Auto merge of #106474 - erikdesjardins:noalias, r=bjorn3bors-6/+1
cleanup: handle -Zmutable-noalias like -Zbox-noalias r? `@bjorn3` cc `@RalfJung` this will conflict with #106180
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-4/+4
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04cleanup: handle -Zmutable-noalias like -Zbox-noaliasErik Desjardins-6/+1
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-4/+4
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-2/+1
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Use `#[derive]` instead of custom syntax in all `newtype_index`Nilstrieb-1/+1
2022-12-01Remove useless borrows and derefsMaybe Waffle-2/+2
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-2469/+12
2022-11-24move some layout logic to rustc_target::abi::layouthkalbasi-7/+1087
2022-11-24make rustc_target usable outside of rustchkalbasi-34/+93
2022-11-19Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3Dylan DPC-0/+28
Improve generating Custom entry function This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316. Currently, this moves the entry function name and Call convention to the target spec. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-0/+10
2022-11-11Improve generating Custom entry functionAyush Singh-0/+28
This commit is aimed at making compiler generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316. Currently, this moves the entry function name and Call convention to the target spec. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-10Rollup merge of #101939 - zhaixiaojuan:loongarch64-abi, r=oli-obkManish Goregaokar-0/+344
Add loongarch64 abi support
2022-10-14more dupe word typosRageking8-1/+1
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-1/+2
2022-10-05change might_permit_raw_init to fully detect LLVM UB, but not more than thatRalf Jung-69/+1
2022-09-17Add loongarch64 abi supportzhaixiaojuan-0/+344
2022-09-16Auto merge of #97800 - ↵bors-8/+42
pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext, r=wesleywiser Aarch64 call abi does not zeroext (and one cannot assume it does so) Fix #97463
2022-09-08translations(rustc_session): migrate TargetDataLayout::parseLuis Cardoso-26/+37
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-2/+2
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-08-26Move `ArgAbi::pad_i32` into `PassMode::Cast`.Nicholas Nethercote-22/+15
Because it's only needed for that variant. This shrinks the types and clarifies the logic.
2022-08-26Turn `ArgAbi::pad` into a `bool`.Nicholas Nethercote-8/+8
Because it's only ever set to `None` or `Some(Reg::i32())`.
2022-08-26Change `FnAbi::args` to a boxed slice.Nicholas Nethercote-25/+25
2022-08-26Change `FnAbi::fixed_count` to a `u32`.Nicholas Nethercote-3/+3
2022-08-26Box `CastTarget` within `PassMode`.Nicholas Nethercote-5/+5
Because `PassMode::Cast` is by far the largest variant, but is relatively rare. This requires making `PassMode` not impl `Copy`, and `Clone` is no longer necessary. This causes lots of sigil adjusting, but nothing very notable.
2022-08-26Add size assertions for `FnAbi` and `ArgAbi`.Nicholas Nethercote-0/+10
2022-08-22rustdoc doesn't like bare urlsWesley Wiser-1/+1
2022-08-09Remove logic related to deprecated nvptx-nvidia-cuda (32-bit) targetKjetil Kjeka-35/+0
2022-08-02Auto merge of #92268 - jswrenn:transmute, r=oli-obkbors-1/+2
Initial implementation of transmutability trait. *T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!* This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`. What this PR provides is: - [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives) - [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays) - [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs) - [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums) - [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions) - [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`) - [x] visibility checking What isn't yet implemented: - [ ] transmutability options passed using the `Assume` struct - [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs) - [ ] smarter error messages These features will be implemented in future PRs.
2022-08-01Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoeristerbors-5/+7
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).
2022-07-31reorder fields in Laout debug outputRalf Jung-6/+7
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-1/+2
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-26Fix vectorcallDaniel Paoliello-5/+7
2022-07-22do not mark interior mutable shared refs as dereferenceableRalf Jung-3/+7
2022-07-22rename PointerKind::Shared → SharedMutable to indicate this is NOT the ↵Ralf Jung-1/+1
usual shared reference
2022-07-14Use constant eval to do strict validity checks5225225-23/+15
2022-07-06fix issue 97463 using change suggested by nbdd0121.Felix S. Klock II-8/+42
parameterized on target details to decide value-extension policy on calls, in order to address how Apple's aarch64 ABI differs from that on Linux and Windows. Updated to incorporate review feedback: adjust comment on new enum specifying param extension policy. Updated to incorporate review feedback: shorten enum names and those of its variants to make it less unwieldy. placate tidy.
2022-06-07Auto merge of #97512 - scottmcm:add-coldcc, r=nagisa,lcnrbors-0/+5
Add support for emitting functions with `coldcc` to LLVM The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-06-06Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obkbors-0/+5
interpret: better control over whether we read data with provenance The resolution in https://github.com/rust-lang/unsafe-code-guidelines/issues/286 seems to be that when we load data at integer type, we implicitly strip provenance. So let's implement that in Miri at least for scalar loads. This makes use of the fact that `Scalar` layouts distinguish pointer-sized integers and pointers -- so I was expecting some wild bugs where layouts set this incorrectly, but so far that does not seem to happen. This does not entirely implement the solution to https://github.com/rust-lang/unsafe-code-guidelines/issues/286; we still do the wrong thing for integers in larger types: we will `copy_op` them and then do validation, and validation will complain about the provenance. To fix that we need mutating validation; validation needs to strip the provenance rather than complaining about it. This is a larger undertaking (but will also help resolve https://github.com/rust-lang/miri/issues/845 since we can reset padding to `Uninit`). The reason this is useful is that we can now implement `addr` as a `transmute` from a pointer to an integer, and actually get the desired behavior of stripping provenance without exposing it!
2022-06-05interpret: better control over whether we read data with provenance, and ↵Ralf Jung-0/+5
implicit provenance stripping where possible
2022-06-03Use serde_json for target spec jsonbjorn3-2/+3
2022-06-03Remove a couple of unused Encodable and Decodable derivesbjorn3-1/+1
2022-05-30Add support for emitting functions with `coldcc` in LLVMScott McMurray-0/+5
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-05-24Add flag for stricter checks on uninit/zeroed5225225-12/+47
2022-05-06make Size and Align debug-printing a bit more compactRalf Jung-2/+16