Skip to content

Commit 14bbb03

Browse files
committed
Auto merge of #155223 - teor2345:fndef-refactor, r=mati865
Refactor FnDecl and FnSig non-type fields into a new wrapper type #### Why this Refactor? This PR is part of an initial cleanup for the [arg splat experiment](rust-lang/rust#153629), but it's a useful refactor by itself. It refactors the non-type fields of `FnDecl`, `FnSig`, and `FnHeader` into a new packed wrapper types, based on this comment in the `splat` experiment PR: rust-lang/rust#153697 (comment) It also refactors some common `FnSig` creation settings into their own methods. I did this instead of creating a struct with defaults. #### Relationship to `splat` Experiment I don't think we can use functional struct updates (`..default()`) to create `FnDecl` and `FnSig`, because we need the bit-packing for the `splat` experiment. Bit-packing will avoid breaking "type is small" assertions for commonly used types when `splat` is added. This PR packs these types: - ExternAbi: enum + `unwind` variants (38) -> 6 bits - ImplicitSelfKind: enum variants (5) -> 3 bits - lifetime_elision_allowed, safety, c_variadic: bool -> 1 bit #### Minor Changes Fixes some typos, and applies rustfmt to clippy files that got skipped somehow.
2 parents f16d286 + b749efb commit 14bbb03

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

crates/stdarch-gen-arm/src/intrinsic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl LLVMLink {
550550

551551
/// Alters all the unsigned types from the signature. This is required where
552552
/// a signed and unsigned variant require the same binding to an exposed
553-
/// LLVM instrinsic.
553+
/// LLVM intrinsic.
554554
pub fn sanitise_uints(&mut self) {
555555
let transform = |tk: &mut TypeKind| {
556556
if let Some(BaseType::Sized(BaseTypeKind::UInt, size)) = tk.base_type() {
@@ -1138,7 +1138,7 @@ impl Intrinsic {
11381138
} else {
11391139
/* If we do not need to reorder anything then immediately add
11401140
* the expressions from the big_endian_expressions and
1141-
* concatinate the compose vector */
1141+
* concatenate the compose vector */
11421142
variant.big_endian_compose.extend(big_endian_expressions);
11431143
variant
11441144
.big_endian_compose
@@ -1156,11 +1156,11 @@ impl Intrinsic {
11561156

11571157
/* If we do not create a shuffle call we do not need modify the
11581158
* return value and append to the big endian ast array. A bit confusing
1159-
* as in code we are making the final call before caputuring the return
1159+
* as in code we are making the final call before capturing the return
11601160
* value of the intrinsic that has been called.*/
11611161
let ret_val_name = "ret_val".to_string();
11621162
if let Some(simd_shuffle_call) = create_shuffle_call(&ret_val_name, return_type) {
1163-
/* There is a possibility that the funcion arguments did not
1163+
/* There is a possibility that the function arguments did not
11641164
* require big endian treatment, thus we need to now add the
11651165
* original function body before appending the return value.*/
11661166
if variant.big_endian_compose.is_empty() {
@@ -1694,8 +1694,8 @@ enum Endianness {
16941694
NA,
16951695
}
16961696

1697-
/// Based on the endianess will create the appropriate intrinsic, or simply
1698-
/// create the desired intrinsic without any endianess
1697+
/// Based on the endianness will create the appropriate intrinsic, or simply
1698+
/// create the desired intrinsic without any endianness
16991699
fn create_tokens(intrinsic: &Intrinsic, endianness: Endianness, tokens: &mut TokenStream) {
17001700
let signature = &intrinsic.signature;
17011701
let fn_name = signature.fn_name().to_string();

0 commit comments

Comments
 (0)