Skip to content
Snippets Groups Projects
Commit 263b2e0c authored by Russel Arbore's avatar Russel Arbore
Browse files

whoops

parent ff03fe68
No related branches found
No related tags found
1 merge request!208IP SROA Parameters
Pipeline #201953 failed
use std::collections::HashMap;
use std::iter::zip;
use hercules_ir::ir::*; use hercules_ir::ir::*;
use crate::*; use crate::*;
...@@ -51,24 +48,24 @@ pub fn interprocedural_sroa( ...@@ -51,24 +48,24 @@ pub fn interprocedural_sroa(
let mut old_return_type_map = vec![]; let mut old_return_type_map = vec![];
let mut changed = false; let mut changed = false;
for ret_typ in param_types.iter() { for par_typ in param_types.iter() {
if !can_sroa_type(editor, *ret_typ) { if !can_sroa_type(editor, *par_typ) {
old_param_type_map.push(IndexTree::Leaf(new_param_types.len())); old_param_type_map.push(IndexTree::Leaf(new_param_types.len()));
new_param_types.push(*ret_typ); new_param_types.push(*par_typ);
} else { } else {
let (types, index) = sroa_type(editor, *ret_typ, new_param_types.len()); let (types, index) = sroa_type(editor, *par_typ, new_param_types.len());
old_param_type_map.push(index); old_param_type_map.push(index);
new_param_types.extend(types); new_param_types.extend(types);
changed = true; changed = true;
} }
} }
for par_typ in return_types.iter() { for ret_typ in return_types.iter() {
if !can_sroa_type(editor, *par_typ) { if !can_sroa_type(editor, *ret_typ) {
old_return_type_map.push(IndexTree::Leaf(new_return_types.len())); old_return_type_map.push(IndexTree::Leaf(new_return_types.len()));
new_return_types.push(*par_typ); new_return_types.push(*ret_typ);
} else { } else {
let (types, index) = sroa_type(editor, *par_typ, new_return_types.len()); let (types, index) = sroa_type(editor, *ret_typ, new_return_types.len());
old_return_type_map.push(index); old_return_type_map.push(index);
new_return_types.extend(types); new_return_types.extend(types);
changed = true; changed = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment