Commit e3bfe139 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Fixed error with file I forgot to commit

parent 2ff53703
......@@ -909,6 +909,14 @@ impl TreeNode {
}
}
/// consumes the TreeNode, returns the instruction in it (or None if it is not an instruction)
pub fn as_inst_ref(&self) -> &Instruction {
match &self.v {
&TreeNode_::Instruction(ref inst) => inst,
_ => panic!("expected inst")
}
}
// The type of the node (for a value node)
pub fn ty(&self) -> P<MuType> {
match self.v {
......@@ -927,6 +935,7 @@ impl TreeNode {
TreeNode_::Value(ref pv) => pv.ty.clone()
}
}
}
impl fmt::Display for TreeNode {
......
......@@ -2325,11 +2325,7 @@ impl<'lb, 'lvm> BundleLoader<'lb, 'lvm> {
blocks: &LinkedHashMap<MuID, Block>,
) -> Vec<Box<TreeNode>> {
let res = self.b.bundle.bbs.get(&id).unwrap().insts.iter().map(|iid| self.build_inst(fcb, *iid, blocks)).collect::<Vec<_>>();
{let rl = res.last();
let rlar = rl.as_ref();
let rlaru = rlar.unwrap();
let rlaruii = rlaru.as_inst_ref();
assert_ir!(rlaruii.is_terminal_inst());}
assert_ir!(res.last().as_ref().unwrap().as_inst_ref().is_terminal_inst());
res
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment