about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/abi
AgeCommit message (Collapse)AuthorLines
2023-03-28Move `mir::Field` → `abi::FieldIdx`Scott McMurray-2/+2
The first PR for https://github.com/rust-lang/compiler-team/issues/606 This is just the move-and-rename, because it's plenty big-and-bitrotty already. Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-15Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into ↵bjorn3-43/+58
sync_cg_clif-2023-03-15
2023-02-24Rename many interner functions.Nicholas Nethercote-3/+3
(This is a large commit. The changes to `compiler/rustc_middle/src/ty/context.rs` are the most important ones.) The current naming scheme is a mess, with a mix of `_intern_`, `intern_` and `mk_` prefixes, with little consistency. In particular, in many cases it's easy to use an iterator interner when a (preferable) slice interner is available. The guiding principles of the new naming system: - No `_intern_` prefixes. - The `intern_` prefix is for internal operations. - The `mk_` prefix is for external operations. - For cases where there is a slice interner and an iterator interner, the former is `mk_foo` and the latter is `mk_foo_from_iter`. Also, `slice_interners!` and `direct_interners!` can now be `pub` or non-`pub`, which helps enforce the internal/external operations division. It's not perfect, but I think it's a clear improvement. The following lists show everything that was renamed. slice_interners - const_list - mk_const_list -> mk_const_list_from_iter - intern_const_list -> mk_const_list - substs - mk_substs -> mk_substs_from_iter - intern_substs -> mk_substs - check_substs -> check_and_mk_substs (this is a weird one) - canonical_var_infos - intern_canonical_var_infos -> mk_canonical_var_infos - poly_existential_predicates - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter - intern_poly_existential_predicates -> mk_poly_existential_predicates - _intern_poly_existential_predicates -> intern_poly_existential_predicates - predicates - mk_predicates -> mk_predicates_from_iter - intern_predicates -> mk_predicates - _intern_predicates -> intern_predicates - projs - intern_projs -> mk_projs - place_elems - mk_place_elems -> mk_place_elems_from_iter - intern_place_elems -> mk_place_elems - bound_variable_kinds - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter - intern_bound_variable_kinds -> mk_bound_variable_kinds direct_interners - region - intern_region (unchanged) - const - mk_const_internal -> intern_const - const_allocation - intern_const_alloc -> mk_const_alloc - layout - intern_layout -> mk_layout - adt_def - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid) - alloc_adt_def(!) -> mk_adt_def - external_constraints - intern_external_constraints -> mk_external_constraints Other - type_list - mk_type_list -> mk_type_list_from_iter - intern_type_list -> mk_type_list - tup - mk_tup -> mk_tup_from_iter - intern_tup -> mk_tup
2023-02-09Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into ↵bjorn3-2/+2
sync_cg_clif-2023-02-09
2023-01-24Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into ↵bjorn3-11/+26
sync_cg_clif-2023-01-24
2022-12-14Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into ↵bjorn3-15/+14
sync_cg_clif-2022-12-14
2022-12-11bug! with a better error message for failing Instance::resolveMichael Goulet-4/+3
2022-11-17Use custom entry name in craneliftAyush Singh-10/+15
This is a continuation of 9f0a8620bd7d325e6d42417b08daff3e55cb88f6 for cranelift. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-10-23Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into ↵bjorn3-2/+51
sync_cg_clif-2022-10-23
2022-10-14more dupe word typosRageking8-1/+1
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-27Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3bors-14/+21
Shrink `FnAbi` Because they can take up a lot of memory in debug and release builds. r? `@bjorn3`
2022-08-26Move `ArgAbi::pad_i32` into `PassMode::Cast`.Nicholas Nethercote-8/+11
Because it's only needed for that variant. This shrinks the types and clarifies the logic.
2022-08-26Box `CastTarget` within `PassMode`.Nicholas Nethercote-12/+16
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-24Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into ↵bjorn3-3/+3
sync_cg_clif-2022-08-24
2022-07-25Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into ↵bjorn3-25/+37
sync_cg_clif-2022-07-25
2022-05-30Use CallConv::Cold in cranelift for extern "rust-cold"Scott McMurray-1/+2
2022-05-30Add support for emitting functions with `coldcc` in LLVMScott McMurray-1/+1
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-05-23Refactor call terminator to always hold a destination placeJakob Degen-41/+28
2022-05-15Merge commit '63734fcdd718cca089f84c42f3a42c0096cfd431' into ↵bjorn3-11/+19
sync_cg_clif-2022-05-15
2022-03-20Merge commit '370c397ec9169809e5ad270079712e0043514240' into ↵bjorn3-2/+8
sync_cg_clif-2022-03-20
2022-03-07Clarify `Layout` interning.Nicholas Nethercote-2/+8
`Layout` is another type that is sometimes interned, sometimes not, and we always use references to refer to it so we can't take any advantage of the uniqueness properties for hashing or equality checks. This commit renames `Layout` as `LayoutS`, and then introduces a new `Layout` that is a newtype around an `Interned<LayoutS>`. It also interns more layouts than before. Previously layouts within layouts (via the `variants` field) were never interned, but now they are. Hence the lifetime on the new `Layout` type. Unlike other interned types, these ones are in `rustc_target` instead of `rustc_middle`. This reflects the existing structure of the code, which does layout-specific stuff in `rustc_target` while `TyAndLayout` is generic over the `Ty`, allowing the type-specific stuff to occur in `rustc_middle`. The commit also adds a `HashStable` impl for `Interned`, which was needed. It hashes the contents, unlike the `Hash` impl which hashes the pointer.
2022-02-21use `List<Ty<'tcx>>` for tupleslcnr-2/+2
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-1/+1
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2021-12-20Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into ↵bjorn3-9/+10
sync_cg_clif-2021-12-20
2021-12-01fix sparc64 ABI for aggregates with floating point membersPetr Sumbera-1/+1
2021-10-12Add const_eval_select intrinsicDeadbeef-2/+2
2021-09-18Querify `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-9/+14
2021-09-18ty::layout: replicate `layout_of` setup for `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-6/+6
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-10/+10
fix fix Remove more refs and clones fix more fix
2021-08-06Merge commit '05677b6bd6c938ed760835d9b1f6514992654ae3' into ↵bjorn3-176/+164
sync_cg_clif-2021-08-06
2021-04-30Sync rustc_codegen_cranelift 'ddd4ce25535cf71203ba3700896131ce55fde795'Erin Power-8/+7
2021-03-29Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into ↵bjorn3-34/+30
sync_cg_clif-2021-03-29
2021-03-09rustc_target: add "unwind" payloads to `Abi`katelyn a. martin-2/+5
### Overview This commit begins the implementation work for RFC 2945. For more information, see the rendered RFC [1] and tracking issue [2]. A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. ### Feature Gate and Unstable Book This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. ### Further Work To Be Done This commit does not proceed to implement the new unwinding ABIs, and is intentionally scoped specifically to *defining* the ABIs and their feature flag. ### One Note on Test Churn This will lead to some test churn, in re-blessing hash tests, as the deleted comment in `src/librustc_target/spec/abi.rs` mentioned, because we can no longer guarantee the ordering of the `Abi` variants. While this is a downside, this decision was made bearing in mind that RFC 2945 states the following, in the "Other `unwind` Strings" section [3]: > More unwind variants of existing ABI strings may be introduced, > with the same semantics, without an additional RFC. Adding a new variant for each of these cases, rather than specifying a payload for a given ABI, would quickly become untenable, and make working with the `Abi` enum prone to mistakes. This approach encodes the unwinding information *into* a given ABI, to account for the future possibility of other `-unwind` ABI strings. ### Ignore Directives `ignore-*` directives are used in two of our `*-unwind` ABI test cases. Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases ignore architectures that do not support `stdcall` and `thiscall`, respectively. These directives are cribbed from `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and `src/test/ui/extern/extern-thiscall.rs` for `thiscall`. This would otherwise fail on some targets, see: https://github.com/rust-lang-ci/rust/commit/fcf697f90206e9c87b39d494f94ab35d976bfc60 ### Footnotes [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md [2]: https://github.com/rust-lang/rust/issues/74990 [3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-05Merge commit '9a0c32934ebe376128230aa8da3275697b2053e7' into ↵bjorn3-291/+107
sync_cg_clif-2021-03-05
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-0/+1
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-02-01Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into ↵bjorn3-445/+593
sync_cg_clif-2021-02-01
2020-12-18Make BoundRegion have a kind of BoungRegionKindJack Huey-1/+1
2020-11-27Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into ↵bjorn3-4/+2
sync_cg_clif-2020-11-27
2020-11-16update `cg_clif`Bastian Kauschke-6/+6
2020-11-03Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into ↵bjorn3-39/+36
update_cg_clif-2020-11-01
2020-10-26Add 'compiler/rustc_codegen_cranelift/' from commit ↵bjorn3-0/+1214
'793d26047f994e23415f8f6bb5686ff25d3dda92' git-subtree-dir: compiler/rustc_codegen_cranelift git-subtree-mainline: cf798c1ec65a5ec3491846777f9003fabb881b4a git-subtree-split: 793d26047f994e23415f8f6bb5686ff25d3dda92