Type checking and Dominator Tree integrity checks in Verifier (#66)

* Verify that a recomputed dominator tree is identical to the existing one.
* The verifier now typechecks instruction results and arguments.
* The verifier now typechecks instruction results and arguments.
* The verifier now typechecks instruction results and arguments.
* Added `inst_{fixed,variable}_args` accessor functions.
* Improved error messages in verifier.
* Type check return statements against the function signature.
This commit is contained in:
Angus Holder
2017-03-29 21:14:42 +01:00
committed by Jakob Stoklund Olesen
parent 6ad34f90aa
commit 892ad25b1b
5 changed files with 269 additions and 15 deletions

View File

@@ -346,12 +346,8 @@ fn check_call_signature(dfg: &DataFlowGraph, inst: Inst) -> Result<(), SigRef> {
/// Check if the arguments of the return `inst` match the signature.
fn check_return_signature(dfg: &DataFlowGraph, inst: Inst, sig: &Signature) -> bool {
let fixed_values = dfg[inst].opcode().constraints().fixed_value_arguments();
check_arg_types(dfg,
dfg.inst_args(inst)
.iter()
.skip(fixed_values)
.cloned(),
dfg.inst_variable_args(inst).iter().cloned(),
&sig.return_types)
}