about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
AgeCommit message (Collapse)AuthorLines
2023-01-25Vendor newer version of cranelift-nativebjorn3-2/+273
It fixes a bug that caused compilation on 32bit x86 to fail
2023-01-24Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into ↵bjorn3-1103/+1134
sync_cg_clif-2023-01-24
2023-01-23Thread a ParamEnv down to might_permit_raw_initBen Kimock-2/+5
2023-01-23Update codegen cranelift for ConstEvalCounterBryan Garza-0/+2
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-1/+2
...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-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-1/+1
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-1/+1
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-66/+66
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-2/+4
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-14Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into ↵bjorn3-1028/+1691
sync_cg_clif-2022-12-14
2022-12-13Rename `assert_uninit_valid` intrinsicNilstrieb-2/+4
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
2022-12-11bug! with a better error message for failing Instance::resolveMichael Goulet-4/+3
2022-12-11Use rint instead of roundevenJules Bertholet-0/+2
Use rint intrinsic instead of roundeven to impement `round_ties_even`. They do the same thing when rounding mode is default, which Rust assumes. And `rint` has better platform support. Keeps `roundeven` around in `core::intrinsics`, it's doing no harm there.
2022-12-11Add `round_ties_even` to `f32` and `f64`Jules Bertholet-0/+2
2022-12-09Remove unneeded field from `SwitchTargets`Jakob Degen-2/+4
2022-12-03Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiserbors-226/+5
Rewrite LLVM's archive writer in Rust This allows it to be used by other codegen backends. Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-2/+2
2022-11-26Rewrite LLVM's archive writer in Rustbjorn3-226/+5
This allows it to be used by other codegen backends
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-9/+4
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-24Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiserbors-2/+2
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-9/+4
2022-11-21Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3Matthias Krüger-35/+23
deduplicate constant evaluation in cranelift backend The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend. I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here. r? ``@bjorn3`` Cc ``@lcnr``
2022-11-19deduplicate constant evaluation in cranelift backendRalf Jung-35/+23
also sync LLVM and cranelift structure a bit
2022-11-19Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3Dylan DPC-12/+21
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-17Use custom entry name in craneliftAyush Singh-12/+21
This is a continuation of 9f0a8620bd7d325e6d42417b08daff3e55cb88f6 for cranelift. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-2/+2
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-1/+1
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-2/+2
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-4/+4
2022-11-09Fix `rustdoc --version` when used with download-rustcJoshua Nelson-1/+1
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source. Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
2022-11-06fix cranelift and gccRalf Jung-2/+2
2022-10-31Rewrite implementation of `#[alloc_error_handler]`Amanieu d'Antras-4/+5
The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`. The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic. This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called. This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-10-27Update toolingMaybe Waffle-7/+2
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-0/+1
2022-10-23Rustfmt cg_clif's build systembjorn3-6/+2
2022-10-23Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into ↵bjorn3-638/+1045
sync_cg_clif-2022-10-23
2022-10-14more dupe word typosRageking8-2/+2
2022-10-06Remove `mir::CastKind::Misc`ouz-a-2/+16
2022-09-27Stabilize bench_black_boxUrgau-1/+1
2022-09-23rename Unevaluated to UnevaluatedConstb-naber-1/+1
2022-09-22introduce mir::Unevaluatedb-naber-11/+2
2022-09-20Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebankbors-0/+9
Allow patterns to constrain the hidden type of opaque types fixes #96572 reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864) TODO: * check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-17Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnrbors-42/+31
Use only ty::Unevaluated<'tcx, ()> in type system r? `@lcnr`
2022-09-16Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, ↵Oli Scherer-0/+9
r=estebank"" This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
2022-09-15nitsb-naber-11/+1
2022-09-14Auto merge of #101212 - eholk:dyn-star, r=compiler-errorsbors-1/+6
Initial implementation of dyn* This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things: * Introduce `dyn_star` feature flag * Adds parsing for `dyn* Trait` types * Defines `dyn* Trait` as a sized type * Adds support for explicit casts, like `42usize as dyn* Debug` * Including const evaluation of such casts * Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope * Adds codegen for method calls, at least for methods that take `&self` Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits. Joint work with `@nikomatsakis` and `@compiler-errors.` r? `@bjorn3`
2022-09-14address review againb-naber-19/+1
2022-09-13Address code review commentsEric Holk-0/+1
2022-09-13cranelift changesb-naber-49/+59