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

Get rid of force abort mechanism

parent 83c8589a
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,6 @@ pub struct FunctionEdit<'a: 'b, 'b> {
added_and_updated: BTreeMap<NodeID, Node>,
// Compute a def-use map entries iteratively.
updated_def_use: BTreeMap<NodeID, HashSet<NodeID>>,
// Technically client edit functions don't have to early exit, so explicitly
// keep track of if this edit should be aborted.
abort: bool,
}
impl<'a: 'b, 'b> FunctionEditor<'a> {
......@@ -106,7 +103,6 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
added: HashSet::new(),
added_and_updated: BTreeMap::new(),
updated_def_use: BTreeMap::new(),
abort: false,
};
if let Ok(populated_edit) = edit(edit_obj) {
......@@ -118,12 +114,7 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
added,
added_and_updated,
updated_def_use,
abort,
} = populated_edit;
if abort {
return false;
}
// Step 1: update the mutable def use map.
for (u, new_users) in updated_def_use {
// Go through new def-use entries in order. These are either
......@@ -185,6 +176,10 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
self.mut_def_use[id.idx()].iter().map(|x| *x)
}
pub fn is_mutable(&self, id: NodeID) -> bool {
self.mutable_nodes[id.idx()]
}
pub fn edits(self) -> Vec<Edit> {
self.edits
}
......@@ -239,7 +234,6 @@ impl<'a, 'b> FunctionEdit<'a, 'b> {
self.deleted.insert(id);
Ok(self)
} else {
self.abort = true;
Err(self)
}
}
......@@ -274,7 +268,6 @@ impl<'a, 'b> FunctionEdit<'a, 'b> {
Ok(self)
} else {
self.abort = true;
Err(self)
}
}
......
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