use param_map instead of localcontext

This commit is contained in:
Folkert 2021-12-05 15:20:55 +01:00
parent 4957b84eae
commit d7045b037f

View file

@ -151,8 +151,7 @@ pub type JPLiveVarMap = MutMap<JoinPointId, LiveVarSet>;
struct Context<'a> {
arena: &'a Bump,
vars: VarMap,
jp_live_vars: JPLiveVarMap, // map: join point => live variables
local_context: LocalContext<'a>, // we use it to store the join point declarations
jp_live_vars: JPLiveVarMap, // map: join point => live variables
param_map: &'a ParamMap<'a>,
}
@ -244,7 +243,6 @@ impl<'a> Context<'a> {
arena,
vars,
jp_live_vars: MutMap::default(),
local_context: LocalContext::default(),
param_map,
}
}
@ -956,7 +954,6 @@ impl<'a> Context<'a> {
};
// TODO use borrow signature here?
let ps = self.param_map.get_join_point(*j);
// let ps = self.local_context.join_points.get(j).unwrap().0;
let b = self.add_inc_before(xs, ps, stmt, j_live_vars);
@ -1014,11 +1011,6 @@ impl<'a> Context<'a> {
}
}
#[derive(Clone, Debug, Default)]
pub struct LocalContext<'a> {
join_points: MutMap<JoinPointId, (&'a [Param<'a>], &'a Stmt<'a>)>,
}
pub fn collect_stmt(
stmt: &Stmt<'_>,
jp_live_vars: &JPLiveVarMap,