summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
AgeCommit message (Collapse)AuthorLines
2021-10-13Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+1
(cherry picked from commit b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573)
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-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
2021-06-15Refactor to make interpreter and codegen backend neutral to vtable internal ↵Charles Lew-34/+38
representation.
2021-06-10Auto merge of #85910 - cjgillot:no-meta-version, r=Aaron1011bors-1/+2
Drop metadata_encoding_version. Part of #85153 r? `@Aaron1011`
2021-06-07Rollup merge of #86016 - luqmana:infer-linker-flavor, r=petrochenkovYuki Okushi-89/+1
Unify duplicate linker_and_flavor methods in rustc_codegen_{cranelift,ssa}. The two methods were exactly the same so this removes the cranelift copy. This will help make sure both they don't get out of sync.
2021-06-07Auto merge of #85810 - bjorn3:further_driver_cleanup, r=varkorbors-27/+6
Driver improvements This PR contains a couple of cleanups for the driver and a few small improvements for the custom codegen backend interface. It also implements `--version` and `-Cpasses=list` support for custom codegen backends.
2021-06-05Unify duplicate linker_and_flavor methods in rustc_codegen_{cranelift,ssa}.Luqman Aden-89/+1
2021-06-06Auto merge of #84171 - ricobbe:raw-dylib-via-llvm, r=petrochenkovbors-0/+9
Partial support for raw-dylib linkage First cut of functionality for issue #58713: add support for `#[link(kind = "raw-dylib")]` on `extern` blocks in lib crates compiled to .rlib files. Does not yet support `#[link_name]` attributes on functions, or the `#[link_ordinal]` attribute, or `#[link(kind = "raw-dylib")]` on `extern` blocks in bin crates; I intend to publish subsequent PRs to fill those gaps. It's also not yet clear whether this works for functions in `extern "stdcall"` blocks; I also intend to investigate that shortly and make any necessary changes as a follow-on PR. This implementation calls out to an LLVM function to construct the actual `.idata` sections as temporary `.lib` files on disk and then links those into the generated .rlib.
2021-06-06Auto merge of #79608 - alessandrod:bpf, r=nagisabors-0/+1
BPF target support This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker. I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-04Add first cut of functionality for #58713: support for #[link(kind = ↵Richard Cobbe-0/+9
"raw-dylib")]. This does not yet support #[link_name] attributes on functions, the #[link_ordinal] attribute, #[link(kind = "raw-dylib")] on extern blocks in bin crates, or stdcall functions on 32-bit x86.
2021-06-04Move crate_name field from OngoingCodegen to CrateInfobjorn3-2/+1
2021-06-04Move windows_subsystem field from CodegenResults to CrateInfobjorn3-16/+0
2021-06-04Allow printing the version of the default codegen backend if it isn't llvmbjorn3-0/+4
2021-06-04Provide default MetadataLoaderbjorn3-5/+1
2021-06-04Provide a default provide* implementation for CodegenBackendbjorn3-4/+0
Both cg_llvm and cg_clif don't override it. cg_spirv does override it, so it needs to be preserved.
2021-06-01Drop metadata_encoding_version.Camille GILLOT-1/+2
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-3/+2
2021-05-30Drop metadata_encoding_version.Camille GILLOT-1/+2
2021-05-30Make allocator_kind a query.Camille GILLOT-1/+1
2021-05-27Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into ↵bjorn3-49/+170
sync_cg_clif-2021-05-27
2021-05-24Change the ice hook for cg_clif to refer to cg_clif's issue trackerbjorn3-2/+23
2021-05-23(try to) fix craneliftRalf Jung-0/+2
2021-05-23Add BPF targetAlessandro Decina-0/+1
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets which can be used to generate little endian and big endian BPF