@@ -186,7 +186,7 @@ impl Opnd
186186
187187 /// Maps the indices from a previous list of instructions to a new list of
188188 /// instructions.
189- pub fn map_index ( self , indices : & Vec < usize > ) -> Opnd {
189+ pub fn map_index ( self , indices : & [ usize ] ) -> Opnd {
190190 match self {
191191 Opnd :: InsnOut { idx, num_bits } => {
192192 Opnd :: InsnOut { idx : indices[ idx] , num_bits }
@@ -1266,11 +1266,11 @@ impl Assembler
12661266
12671267 /// Spill all live registers to the stack
12681268 pub fn spill_regs ( & mut self ) {
1269- self . spill_regs_except ( & vec ! [ ] ) ;
1269+ self . spill_regs_except ( & [ ] ) ;
12701270 }
12711271
12721272 /// Spill all live registers except `ignored_temps` to the stack
1273- pub fn spill_regs_except ( & mut self , ignored_temps : & Vec < RegOpnd > ) {
1273+ pub fn spill_regs_except ( & mut self , ignored_temps : & [ RegOpnd ] ) {
12741274 // Forget registers above the stack top
12751275 let mut reg_mapping = self . ctx . get_reg_mapping ( ) ;
12761276 for stack_idx in self . ctx . get_stack_size ( ) ..MAX_CTX_TEMPS as u8 {
@@ -1348,6 +1348,7 @@ impl Assembler
13481348
13491349 // Shuffle register moves, sometimes adding extra moves using SCRATCH_REG,
13501350 // so that they will not rewrite each other before they are used.
1351+ #[ allow( clippy:: ptr_arg) ]
13511352 pub fn reorder_reg_moves ( old_moves : & Vec < ( Reg , Opnd ) > ) -> Vec < ( Reg , Opnd ) > {
13521353 // Return the index of a move whose destination is not used as a source if any.
13531354 fn find_safe_move ( moves : & Vec < ( Reg , Opnd ) > ) -> Option < usize > {
@@ -1385,6 +1386,7 @@ impl Assembler
13851386 /// Sets the out field on the various instructions that require allocated
13861387 /// registers because their output is used as the operand on a subsequent
13871388 /// instruction. This is our implementation of the linear scan algorithm.
1389+ #[ allow( clippy:: useless_conversion) ]
13881390 pub ( super ) fn alloc_regs ( mut self , regs : Vec < Reg > ) -> Assembler
13891391 {
13901392 //dbg!(&self);
@@ -1394,7 +1396,7 @@ impl Assembler
13941396
13951397 // Mutate the pool bitmap to indicate that the register at that index
13961398 // has been allocated and is live.
1397- fn alloc_reg ( pool : & mut u32 , regs : & Vec < Reg > ) -> Option < Reg > {
1399+ fn alloc_reg ( pool : & mut u32 , regs : & [ Reg ] ) -> Option < Reg > {
13981400 for ( index, reg) in regs. iter ( ) . enumerate ( ) {
13991401 if ( * pool & ( 1 << index) ) == 0 {
14001402 * pool |= 1 << index;
@@ -1405,7 +1407,7 @@ impl Assembler
14051407 }
14061408
14071409 // Allocate a specific register
1408- fn take_reg ( pool : & mut u32 , regs : & Vec < Reg > , reg : & Reg ) -> Reg {
1410+ fn take_reg ( pool : & mut u32 , regs : & [ Reg ] , reg : & Reg ) -> Reg {
14091411 let reg_index = regs. iter ( ) . position ( |elem| elem. reg_no == reg. reg_no ) ;
14101412
14111413 if let Some ( reg_index) = reg_index {
@@ -1419,7 +1421,7 @@ impl Assembler
14191421 // Mutate the pool bitmap to indicate that the given register is being
14201422 // returned as it is no longer used by the instruction that previously
14211423 // held it.
1422- fn dealloc_reg ( pool : & mut u32 , regs : & Vec < Reg > , reg : & Reg ) {
1424+ fn dealloc_reg ( pool : & mut u32 , regs : & [ Reg ] , reg : & Reg ) {
14231425 let reg_index = regs. iter ( ) . position ( |elem| elem. reg_no == reg. reg_no ) ;
14241426
14251427 if let Some ( reg_index) = reg_index {
@@ -1791,7 +1793,7 @@ impl Assembler {
17911793 }
17921794
17931795 /// Let vm_check_canary() assert the leafness of this ccall if leaf_ccall is set
1794- fn set_stack_canary ( & mut self , opnds : & Vec < Opnd > ) -> Option < Opnd > {
1796+ fn set_stack_canary ( & mut self , opnds : & [ Opnd ] ) -> Option < Opnd > {
17951797 // Use the slot right above the stack top for verifying leafness.
17961798 let canary_opnd = self . stack_opnd ( -1 ) ;
17971799
0 commit comments