This commit is contained in:
Folkert 2021-07-25 20:55:40 +02:00
parent 204aa6f88a
commit 079c95b993

View file

@ -352,8 +352,7 @@ impl<'a> BorrowInfState<'a> {
self.current_proc
),
Some(set) => {
if set.contains(&extracted) {
if set.insert(structure) {
if set.contains(&extracted) && set.insert(structure) {
// entered if key was not yet present. If so, the set is modified,
// hence we set this flag
self.modified = true;
@ -361,7 +360,6 @@ impl<'a> BorrowInfState<'a> {
}
}
}
}
fn is_owned(&self, x: Symbol) -> bool {
match self.owned.get(&self.current_proc) {
@ -380,7 +378,7 @@ impl<'a> BorrowInfState<'a> {
*p
} else if self.is_owned(p.symbol) {
self.modified = true;
let mut p = p.clone();
let mut p = *p;
p.borrow = false;
p
@ -395,7 +393,6 @@ impl<'a> BorrowInfState<'a> {
fn update_param_map_declaration(
&mut self,
param_map: &mut ParamMap<'a>,
symbol: Symbol,
start: ParamOffset,
length: usize,
) {
@ -883,7 +880,7 @@ impl<'a> BorrowInfState<'a> {
self.owned.entry(proc.name).or_default();
self.collect_stmt(param_map, &proc.body);
self.update_param_map_declaration(param_map, proc.name, param_offset, proc.args.len());
self.update_param_map_declaration(param_map, param_offset, proc.args.len());
self.param_set = old;
}
@ -1008,12 +1005,7 @@ fn call_info_call<'a>(call: &crate::ir::Call<'a>, info: &mut CallInfo<'a>) {
use crate::ir::CallType::*;
match call.call_type {
ByName {
name,
ret_layout,
arg_layouts,
..
} => {
ByName { name, .. } => {
info.keys.push(name);
}
Foreign { .. } => {}