about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
AgeCommit message (Collapse)AuthorLines
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-1/+1
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+1
2021-10-03Move rustc_middle::middle::cstore to rustc_session.Camille GILLOT-1/+1
2021-09-30Move EncodedMetadata to rustc_metadata.Camille GILLOT-4/+4
2021-09-30Move encode_metadata out of CrateStore.Camille GILLOT-1/+5
2021-09-26Auto merge of #89092 - bjorn3:sync_cg_clif-2021-09-19, r=bjorn3bors-209/+215
Sync rustc_codegen_cranelift Nothing exciting this time. Mostly internal refactorings. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2021-09-25Introduce `Rvalue::ShallowInitBox`Gary Guo-0/+7
2021-09-20Adjust to SourceType::InTree in several placesMark Rousskov-1/+0
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
2021-09-19Merge commit '61667dedf55e3e5aa584f7ae2bd0471336b92ce9' into ↵bjorn3-210/+215
sync_cg_clif-2021-09-19
2021-09-18Querify `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-13/+21
2021-09-18ty::layout: replicate `layout_of` setup for `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-16/+65
2021-09-18ty::layout: intern `FnAbi`s as `&'tcx`.Eduard-Mihai Burtescu-1/+1
2021-09-12Auto merge of #88839 - nbdd0121:alignof, r=nagisabors-4/+9
Introduce NullOp::AlignOf This PR introduces `Rvalue::NullaryOp(NullOp::AlignOf, ty)`, which will be lowered from `align_of`, similar to `size_of` lowering to `Rvalue::NullaryOp(NullOp::SizeOf, ty)`. The changes are originally part of #88700 but since it's not dependent on other changes and could have performance impact on its own, it's separated into its own PR.
2021-09-13Introduce NullOp::AlignOfGary Guo-4/+9
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-27/+21
fix fix Remove more refs and clones fix more fix
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-2/+1
2021-09-05Auto merge of #88499 - eddyb:layout-off, r=nagisabors-19/+17
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-05Auto merge of #88559 - bjorn3:archive_logic_dedup, r=cjgillotbors-64/+19
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-03Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebankbors-2/+2
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-02Use in_incr_comp_dir_sess in cg_clifbjorn3-2/+1
2021-09-02ty::layout: split `LayoutOf` into required and (blanket) provided halves.Eduard-Mihai Burtescu-3/+3
2021-09-02ty::layout: implement `layout_of` automatically as a default method.Eduard-Mihai Burtescu-11/+11
2021-09-02rustc_target: move `LayoutOf` to `ty::layout`.Eduard-Mihai Burtescu-6/+4
2021-09-01Move add_rlib and add_native_library to cg_ssabjorn3-64/+19
This deduplicates logic between codegen backends
2021-08-30rustc_target: `TyAndLayout::field` should never error.Eduard-Mihai Burtescu-8/+6
2021-08-27rustc_target: add lifetime parameter to `LayoutOf`.Eduard-Mihai Burtescu-2/+2
2021-08-27Path remapping: Make behavior of diagnostics output dependent on presence of ↵Michael Woerister-2/+2
--remap-path-prefix.
2021-08-26make unevaluated const substs optionallcnr-5/+5
2021-08-18Fold `vtable_trait_upcasting_coercion_new_vptr_slot` logic into obligation ↵Charles Lew-14/+3
processing.
2021-08-15Update rustc_codegen_cratelift for working_dir changeAaron Hill-1/+1
2021-08-12Implement `black_box` using intrinsicGary Guo-0/+5
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-06Merge commit '05677b6bd6c938ed760835d9b1f6514992654ae3' into ↵bjorn3-446/+538
sync_cg_clif-2021-08-06
2021-08-03Implement pointer casting.Charles Lew-16/+49
2021-07-18Rollup merge of #87092 - ricobbe:fix-raw-dylib-multiple-definitions, ↵Yuki Okushi-3/+1
r=petrochenkov Remove nondeterminism in multiple-definitions test Compare all fields in `DllImport` when sorting to avoid nondeterminism in the error for multiple inconsistent definitions of an extern function. Restore the multiple-definitions test. Resolves #87084.
2021-07-16Consider all fields when comparing DllImports, to remove nondetermininsm in ↵Richard Cobbe-3/+1
multiple-definitions test
2021-07-14fix craneliftRalf Jung-10/+11
2021-07-08Use cranelift's `Type::int` instead of doing the match myselfScott McMurray-8/+1
<https://docs.rs/cranelift-codegen/0.74.0/cranelift_codegen/ir/types/struct.Type.html#method.int>
2021-07-08PR Feedback: Don't put SSA-only types in `CValue`sScott McMurray-9/+9
2021-07-08Implement the raw_eq intrinsic in codegen_craneliftScott McMurray-0/+45
2021-07-07Merge commit '3a31c6d8272c14388a34622193baf553636fe470' into ↵bjorn3-126/+306
sync_cg_clif-2021-07-07
2021-07-06Don't pass local_crate_name to link_binary separatelybjorn3-1/+0
It is already part of CodegenResults
2021-07-06Move LinkerInfo into CrateInfobjorn3-4/+2
2021-07-05Remove LibSourcebjorn3-1/+1
The information is stored in used_crate_source too anyway
2021-06-29Auto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3bors-102/+14
Change vtable memory representation to use tcx allocated allocations. This fixes https://github.com/rust-lang/rust/issues/86324. However i suspect there's more to change before it can land. r? `@bjorn3` cc `@rust-lang/miri`
2021-06-28Update other codegens to use tcx managed vtable allocations.Charles Lew-102/+14
2021-06-28Auto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011bors-1/+1
Make allocator_kind a query. Part of #85153 r? `@Aaron1011`
2021-06-25Auto merge of #85640 - bjorn3:custom_ice_hook, r=jackh726bors-2/+23
Allow changing the bug report url for the ice hook cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/1174
2021-06-20Make allocator_kind a query.Camille GILLOT-1/+1
2021-06-16Auto merge of #86291 - crlf0710:trait_vtbl_refactor, r=bjorn3bors-34/+38
Refactor vtable codegen This refactor the codegen of vtables of miri interpreter, llvm, cranelift codegen backends. This is preparation for the implementation of trait upcasting feature. cc #65991 Note that aside from code reorganization, there's an internal behavior change here that now InstanceDef::Virtual's index now include the three metadata slots, and now the first method is with index 3. cc `@RalfJung` `@bjorn3`
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-1/+1