Skip to content

Commit

Permalink
stack2reg: Re-add clone() to stop CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Aug 23, 2020
1 parent c62f433 commit 80ee042
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/optimize/stack2reg.rs
Expand Up @@ -315,13 +315,14 @@ fn remove_unused_stack_addr_and_stack_load(opt_ctx: &mut OptimizeContext<'_>) {

// Replace all unused stack_addr and stack_load instructions with nop.
for stack_slot_users in opt_ctx.stack_slot_usage_map.values_mut() {
while let Some(&inst) = stack_slot_users.stack_addr.iter().next() {
// FIXME: Remove clone
for &inst in stack_slot_users.stack_addr.clone().iter() {
if stack_addr_load_insts_users.get(&inst).map(|users| users.is_empty()).unwrap_or(true) {
stack_slot_users.remove_unused_stack_addr(&mut opt_ctx.ctx.func, inst);
}
}

while let Some(&inst) = stack_slot_users.stack_load.iter().next() {
for &inst in stack_slot_users.stack_load.clone().iter() {
if stack_addr_load_insts_users.get(&inst).map(|users| users.is_empty()).unwrap_or(true) {
stack_slot_users.remove_unused_load(&mut opt_ctx.ctx.func, inst);
}
Expand Down

0 comments on commit 80ee042

Please sign in to comment.