Commit Graph

2325 Commits

Author SHA1 Message Date
bjorn3
4560603b1c Re-enable portable simd testing 2021-09-12 20:27:50 +02:00
bjorn3
d480d9ee3b Rustup to rustc 1.57.0-nightly (8c2b6ea37 2021-09-11) 2021-09-12 19:40:01 +02:00
bjorn3
94ad37cd3d Sync from rust c7dbe7a830 2021-09-12 19:25:17 +02:00
Andreas Liljeqvist
a81217c12d Make abi::Abi Copy and remove a *lot* of refs
fix

fix

Remove more refs and clones

fix

more

fix
2021-09-09 10:41:19 +02:00
bjorn3
7736e0afb8 Avoid unnecessary duplicate metadata encoding 2021-09-08 18:54:48 +02:00
bjorn3
8a28d7a07f Add portable-simd to .gitignore 2021-09-07 20:45:58 +02:00
bjorn3
0a8787fdda Rustup to rustc 1.57.0-nightly (1698e3cac 2021-09-06) 2021-09-07 20:45:28 +02:00
bjorn3
95f06887ea Sync from rust 73641cd23b 2021-09-07 20:45:09 +02:00
Camille GILLOT
9ad50a41fe Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
Camille GILLOT
8cc1012f3f Move monomorphize code to its own crate. 2021-09-07 19:53:04 +02:00
bors
0167838a18 Auto merge of #88499 - eddyb:layout-off, r=nagisa
Provide `layout_of` automatically (given tcx + param_env + error handling).

After #88337, there's no longer any uses of `LayoutOf` within `rustc_target` itself, so I realized I could move the trait to `rustc_middle::ty::layout` and redesign it a bit.

This is similar to #88338 (and supersedes it), but at no ergonomic loss, since there's no funky `C: LayoutOf<Ty = Ty>` -> `Ty: TyAbiInterface<C>` generic `impl` chain, and each `LayoutOf` still corresponds to one `impl` (of `LayoutOfHelpers`) for the specific context.

After this PR, this is what's needed to get `trait LayoutOf` (with the `layout_of` method) implemented on some context type:
* `TyCtxt`, via `HasTyCtxt`
* `ParamEnv`, via `HasParamEnv`
* a way to transform `LayoutError`s into the desired error type
  * an error type of `!` can be paired with having `cx.layout_of(...)` return `TyAndLayout` *without* `Result<...>` around it, such as used by codegen
  * this is done through a new `LayoutOfHelpers` trait (and so is specifying the type of `cx.layout_of(...)`)

When going through this path (and not bypassing it with a manual `impl` of `LayoutOf`), the end result is that only the error case can be customized, the query itself and the success paths are guaranteed to be uniform.

(**EDIT**: just noticed that because of the supertrait relationship, you cannot actually implement `LayoutOf` yourself, the blanket `impl` fully covers all possible context types that could ever implement it)

Part of the motivation for this shape of API is that I've been working on querifying `FnAbi::of_*`, and what I want/need to introduce for that looks a lot like the setup in this PR - in particular, it's harder to express the `FnAbi` methods in `rustc_target`, since they're much more tied to `rustc` concepts.

r? `@nagisa` cc `@oli-obk` `@bjorn3`
2021-09-05 16:14:41 +00:00
bors
771c2c6986 Auto merge of #88559 - bjorn3:archive_logic_dedup, r=cjgillot
Move add_rlib and add_native_library to cg_ssa

This deduplicates logic between codegen backends.

cc `@antoyo` and `@khyperia` for cg_gcc and rust-gpu.
2021-09-05 04:37:12 +00:00
bors
e7e930360c Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank
Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.

This PR fixes a regression (#87745) with `--remap-path-prefix` where the flag stopped causing diagnostic messages to be remapped as well. The regression was introduced in https://github.com/rust-lang/rust/pull/83813 where we erroneously assumed that remapping of diagnostic messages was not desired anymore (because #70642 partially undid that functionality with nobody objecting).

The issue is fixed by making `--remap-path-prefix` remap diagnostic messages again, including for paths that have been remapped in upstream crates (e.g. the standard library). This means that "sysroot-localization" (implemented in #70642) is also disabled if `rustc` is invoked with `--remap-path-prefix`. The assumption is that once someone starts explicitly remapping paths they also don't want paths to their local Rust installation in their build output.

In the future we might want to give more fine-grained control over this behavior via compiler flags (see https://github.com/rust-lang/rfcs/pull/3127 for a related RFC). For now this PR is intended as a regression fix.

This PR is an alternative to https://github.com/rust-lang/rust/pull/88191, which makes diagnostic messages be remapped unconditionally. That approach, however, would effectively revert #70642.

Fixes https://github.com/rust-lang/rust/issues/87745.

cc `@cbeuw`
r? `@ghost`
2021-09-03 00:23:10 +00:00
bjorn3
e6049759d0 Use in_incr_comp_dir_sess in cg_clif 2021-09-02 12:29:12 +02:00
Eduard-Mihai Burtescu
dc6c4defdc ty::layout: split LayoutOf into required and (blanket) provided halves. 2021-09-02 01:17:14 +03:00
Eduard-Mihai Burtescu
6a9c9b0f18 ty::layout: implement layout_of automatically as a default method. 2021-09-02 01:17:14 +03:00
Eduard-Mihai Burtescu
b710c0d48c rustc_target: move LayoutOf to ty::layout. 2021-09-02 01:17:14 +03:00
bjorn3
ddaa7459b2 Update clean_all.sh for the rename of stdsimd to portable-simd 2021-09-01 17:21:50 +02:00
bjorn3
33b62ae3f3 Disable protable-simd tests
Portable-simd doesn't compile on latest nightly
2021-09-01 15:06:25 +02:00
bjorn3
66ccff19b8 Update protable-simd 2021-09-01 15:05:03 +02:00
bjorn3
677c786109 Move add_rlib and add_native_library to cg_ssa
This deduplicates logic between codegen backends
2021-09-01 14:43:27 +02:00
bjorn3
0b007722ad Rustup to rustc 1.56.0-nightly (29ef6cf16 2021-08-31) 2021-09-01 14:21:36 +02:00
bjorn3
0ff530eac8 Sync from rust 3ed6c1d23f 2021-09-01 14:00:09 +02:00
Eduard-Mihai Burtescu
39e16da529 rustc_target: TyAndLayout::field should never error. 2021-08-30 00:44:09 +03:00
bjorn3
e9eac6bd93 Remove unnecessary feature gates
One wasn't necessary anymore at all. Others are only necessary when jit mode is enabled.
2021-08-27 15:17:17 +02:00
bjorn3
6f5c9b97dc Enable some warnings 2021-08-27 14:04:00 +02:00
Eduard-Mihai Burtescu
d9f0448815 rustc_target: add lifetime parameter to LayoutOf. 2021-08-27 13:09:32 +03:00
Michael Woerister
7753eda91a Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix. 2021-08-27 11:50:44 +02:00
lcnr
e0ea466661 make unevaluated const substs optional 2021-08-26 11:00:30 +02:00
bjorn3
9f5b52045c Filter out tests marked with needs-asm-support 2021-08-25 15:17:34 +02:00
bjorn3
d1f164142b Update patches/0027-sysroot-128bit-atomic-operations.patch 2021-08-25 13:46:15 +02:00
bjorn3
92f488754b Rustup to rustc 1.56.0-nightly (b03ccace5 2021-08-24) 2021-08-25 13:12:40 +02:00
bjorn3
f865bbbecf Sync from rust 9863bf51a5 2021-08-25 13:05:20 +02:00
bors
21fff2c6c3 Auto merge of #88135 - crlf0710:trait_upcasting_part_3, r=nikomatsakis
Trait upcasting coercion (part 3)

By using separate candidates for each possible choice, this fixes type-checking issues in previous commits.

r? `@nikomatsakis`
2021-08-21 21:14:07 +00:00
bjorn3
47e4a62ac5 Move all code out of backend.rs 2021-08-20 21:43:53 +02:00
bjorn3
14617516f8 Make {Debug,Unwind}Context::emit non-generic 2021-08-20 21:38:50 +02:00
bjorn3
d8308ece36 Move Object creation into metadata.rs 2021-08-20 21:38:17 +02:00
bjorn3
a929c952d4 Add more architectures to with_object 2021-08-20 21:32:04 +02:00
bjorn3
d29e0484cf Revert "Remove unnecessary bailout in clif_pair_type_from_ty"
This reverts commit 3b22c3a8ec.

Seems to be necessary after all. At least when compiling regex.
2021-08-20 19:58:38 +02:00
bjorn3
3b22c3a8ec Remove unnecessary bailout in clif_pair_type_from_ty 2021-08-20 19:30:16 +02:00
bjorn3
edadc29c77 Rustup to rustc 1.56.0-nightly (6d64f7f69 2021-08-19) 2021-08-20 16:15:52 +02:00
bjorn3
7a781a53f0 Sync from rust 9ccf661694 2021-08-20 15:06:07 +02:00
Marcel Hellwig
8b8ab5f599 remove box_syntax uses from cranelift and tools 2021-08-18 09:31:51 +02:00
Charles Lew
03ed8c8115 Fold vtable_trait_upcasting_coercion_new_vptr_slot logic into obligation processing. 2021-08-18 13:00:27 +08:00
Aaron Hill
1bfa59afe0 Update rustc_codegen_cratelift for working_dir change 2021-08-15 15:17:37 -05:00
Gary Guo
74b17685fe Implement black_box using intrinsic
The new implementation allows some `memcpy`s to be optimized away,
so the uninit value in ui/sanitize/memory.rs is constructed directly
onto the return place. Therefore the sanitizer now says that the
value is allocated by `main` rather than `random`.
2021-08-12 16:16:57 +01:00
bjorn3
d498e6d697 Avoid an unnecessary allocation 2021-08-10 13:19:22 +02:00
bjorn3
6681694cb5 Avoid converting filenames into strings where possible 2021-08-10 13:19:22 +02:00
bjorn3
1da50543dd Use the object crate for archive reading during archive building 2021-08-10 13:19:22 +02:00
bjorn3
c11d8f5be1
Add warning to the jit mode section of the usage docs
Closes #1192
2021-08-09 12:30:40 +02:00