11use itertools:: Itertools ;
22
3+ use crate :: common:: SupportedArchitecture ;
34use crate :: common:: intrinsic_helpers:: TypeKind ;
45use crate :: common:: values:: test_values_array_name;
56
@@ -9,22 +10,22 @@ use super::intrinsic_helpers::TypeDefinition;
910
1011/// An argument for the intrinsic.
1112#[ derive( Debug , PartialEq , Clone ) ]
12- pub struct Argument < T : TypeDefinition > {
13+ pub struct Argument < A : SupportedArchitecture > {
1314 /// The argument's index in the intrinsic function call.
1415 pub pos : usize ,
1516 /// The argument name.
1617 pub name : String ,
1718 /// The type of the argument.
18- pub ty : T ,
19+ pub ty : A :: Type ,
1920 /// Any constraints that are on this argument
2021 pub constraint : Option < Constraint > ,
2122}
2223
23- impl < T > Argument < T >
24+ impl < A > Argument < A >
2425where
25- T : TypeDefinition ,
26+ A : SupportedArchitecture ,
2627{
27- pub fn new ( pos : usize , name : String , ty : T , constraint : Option < Constraint > ) -> Self {
28+ pub fn new ( pos : usize , name : String , ty : A :: Type , constraint : Option < Constraint > ) -> Self {
2829 Argument {
2930 pos,
3031 name,
@@ -63,13 +64,13 @@ where
6364
6465/// Arguments of an intrinsic - including parameters that end up being const generics.
6566#[ derive( Debug , PartialEq , Clone ) ]
66- pub struct ArgumentList < T : TypeDefinition > {
67- pub args : Vec < Argument < T > > ,
67+ pub struct ArgumentList < A : SupportedArchitecture > {
68+ pub args : Vec < Argument < A > > ,
6869}
6970
70- impl < T > ArgumentList < T >
71+ impl < A > ArgumentList < A >
7172where
72- T : TypeDefinition ,
73+ A : SupportedArchitecture ,
7374{
7475 /// Returns a string with the arguments in `self` as a parameter list for a wrapper fn
7576 /// definition in C (e.g. `$ty1 $arg1, $ty2 $arg2`).
@@ -196,7 +197,7 @@ where
196197 }
197198
198199 /// Returns an iterator over the contained arguments
199- pub fn iter ( & self ) -> std:: slice:: Iter < ' _ , Argument < T > > {
200+ pub fn iter ( & self ) -> std:: slice:: Iter < ' _ , Argument < A > > {
200201 self . args . iter ( )
201202 }
202203}
0 commit comments