Make code that tests for specific opcode families more consistent.
This commit is contained in:
@@ -56,19 +56,19 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is
|
|||||||
let opcode = pos.func.dfg[inst].opcode();
|
let opcode = pos.func.dfg[inst].opcode();
|
||||||
|
|
||||||
// Check for ABI boundaries that need to be converted to the legalized signature.
|
// Check for ABI boundaries that need to be converted to the legalized signature.
|
||||||
if opcode.is_call() && boundary::handle_call_abi(inst, pos.func, cfg) {
|
if opcode.is_call() {
|
||||||
// Go back and legalize the inserted argument conversion instructions.
|
if boundary::handle_call_abi(inst, pos.func, cfg) {
|
||||||
pos.set_position(prev_pos);
|
// Go back and legalize the inserted argument conversion instructions.
|
||||||
continue;
|
pos.set_position(prev_pos);
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
if opcode.is_return() && boundary::handle_return_abi(inst, pos.func, cfg) {
|
} else if opcode.is_return() {
|
||||||
// Go back and legalize the inserted return value conversion instructions.
|
if boundary::handle_return_abi(inst, pos.func, cfg) {
|
||||||
pos.set_position(prev_pos);
|
// Go back and legalize the inserted return value conversion instructions.
|
||||||
continue;
|
pos.set_position(prev_pos);
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
if opcode.is_branch() {
|
} else if opcode.is_branch() {
|
||||||
split::simplify_branch_arguments(&mut pos.func.dfg, inst);
|
split::simplify_branch_arguments(&mut pos.func.dfg, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ impl<'a> LocationVerifier<'a> {
|
|||||||
let opcode = dfg[inst].opcode();
|
let opcode = dfg[inst].opcode();
|
||||||
if opcode.is_return() {
|
if opcode.is_return() {
|
||||||
self.check_return_abi(inst, &divert)?;
|
self.check_return_abi(inst, &divert)?;
|
||||||
}
|
} else if opcode.is_branch() {
|
||||||
|
if !divert.is_empty() {
|
||||||
if opcode.is_branch() && !divert.is_empty() {
|
self.check_cfg_edges(inst, &divert)?;
|
||||||
self.check_cfg_edges(inst, &divert)?;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.update_diversions(inst, &mut divert)?;
|
self.update_diversions(inst, &mut divert)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user