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

Updated rust formating

parent 71a74d9c
Pipeline #827 failed with stages
in 30 minutes and 35 seconds
......@@ -365,15 +365,9 @@ impl<'a> InstructionSelection {
}
// jcc - for 8-bits integer
_ => {
let blk_true = make_block_name(&node.name(),
"select_true"
);
let blk_false = make_block_name(&node.name(),
"select_false"
);
let blk_end = make_block_name(&node.name(),
"select_end"
);
let blk_true = make_block_name(&node.name(), "select_true");
let blk_false = make_block_name(&node.name(), "select_false");
let blk_end = make_block_name(&node.name(), "select_end");
// jump to blk_true if true
match cmpop {
......@@ -436,12 +430,9 @@ impl<'a> InstructionSelection {
} else if self.match_fpreg(true_val) {
let tmp_res = self.get_result_value(node);
let blk_true =
make_block_name(&node.name(), "select_true");
let blk_false =
make_block_name(&node.name(), "select_false");
let blk_end =
make_block_name(&node.name(), "select_end");
let blk_true = make_block_name(&node.name(), "select_true");
let blk_false = make_block_name(&node.name(), "select_false");
let blk_end = make_block_name(&node.name(), "select_end");
// jump to blk_true if true
match cmpop {
......@@ -596,7 +587,8 @@ impl<'a> InstructionSelection {
}
self.finish_block();
let block_name = make_block_name(&node.name(),
let block_name = make_block_name(
&node.name(),
format!("switch_not_met_case_{}", case_op_index).as_str()
);
self.start_block(block_name);
......@@ -1089,13 +1081,16 @@ impl<'a> InstructionSelection {
// testq %tmp_op %tmp_op
self.backend.emit_test_r_r(&tmp_op, &tmp_op);
let blk_if_signed = make_block_name(&node.name(),
let blk_if_signed = make_block_name(
&node.name(),
"uitofp_float_if_signed"
);
let blk_if_not_signed = make_block_name(&node.name(),
let blk_if_not_signed = make_block_name(
&node.name(),
"uitofp_float_if_not_signed"
);
let blk_done = make_block_name(&node.name(),
let blk_done = make_block_name(
&node.name(),
"uitofp_float_done"
);
......@@ -3071,8 +3066,7 @@ impl<'a> InstructionSelection {
// emit: >> large object alloc
// emit: ALLOC_LARGE_END:
let blk_alloc_large = make_block_name(&node.name(), "alloc_large");
let blk_alloc_large_end =
make_block_name(&node.name(), "alloc_large_end");
let blk_alloc_large_end = make_block_name(&node.name(), "alloc_large_end");
if OBJECT_HEADER_SIZE != 0 {
// if the header size is not zero, we need to calculate a total size to alloc
......@@ -4028,8 +4022,7 @@ impl<'a> InstructionSelection {
// insert an intermediate block to branch to normal
// the branch is inserted later (because we need to deal with postcall convention)
self.finish_block();
let block_name =
make_block_name(&node.name(), "normal_cont_for_call");
let block_name = make_block_name(&node.name(), "normal_cont_for_call");
self.start_block(block_name);
} else {
self.current_callsites
......
......@@ -232,7 +232,8 @@ impl BackendType {
pub fn resolve(ty: &MuType, vm: &VM) -> BackendType {
match ty.v {
// integer
MuType_::Int(size_in_bit) => match size_in_bit {
MuType_::Int(size_in_bit) => {
match size_in_bit {
1...8 => BackendType {
size: 1,
alignment: 1,
......@@ -269,7 +270,8 @@ impl BackendType {
gc_type: mm::add_gc_type(GCType::new_noreftype(16, 16))
},
_ => unimplemented!()
},
}
}
// reference of any type
MuType_::Ref(_) | MuType_::IRef(_) | MuType_::WeakRef(_) => BackendType {
size: 8,
......
......@@ -466,7 +466,13 @@ fn copy_inline_blocks(
let ref ops = inst.ops;
let ref v = inst.v;
trace!("ISAAC: Inlining [{} -> {}] : {} -> {}", old_block.name(), block_name, inst_name, hdr.name());
trace!(
"ISAAC: Inlining [{} -> {}] : {} -> {}",
old_block.name(),
block_name,
inst_name,
hdr.name()
);
match v {
&Instruction_::Return(ref vec) => {
// change RET to a branch
......@@ -517,7 +523,10 @@ fn copy_inline_blocks(
trace!("rewrite to: {}", branch2);
block_content.body.push(TreeNode::new_boxed_inst(branch2));
}
&Instruction_::Call { ref data, ref resume } => {
&Instruction_::Call {
ref data,
ref resume
} => {
let call = Instruction {
hdr: hdr,
value: value.clone(),
......@@ -531,7 +540,10 @@ fn copy_inline_blocks(
trace!("rewrite to: {}", call);
block_content.body.push(TreeNode::new_boxed_inst(call));
}
&Instruction_::CCall { ref data, ref resume } => {
&Instruction_::CCall {
ref data,
ref resume
} => {
let call = Instruction {
hdr: hdr,
value: value.clone(),
......@@ -557,8 +569,11 @@ fn copy_inline_blocks(
v: Instruction_::Switch {
cond: *cond,
default: fix_dest(default.clone()),
branches: branches.iter()
.map(|&(ref op, ref dest)| (op.clone(), fix_dest(dest.clone())))
branches: branches
.iter()
.map(|&(ref op, ref dest)| {
(op.clone(), fix_dest(dest.clone()))
})
.collect()
}
};
......
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