Always require a Flags reference for verifying functions.
Add a settings::FlagsOrIsa struct which represents a flags reference and optionally the ISA it belongs to. Use this for passing flags/isa information to the verifier. The verify_function() and verify_context() functions are now generic so they accept either a &Flags or a &TargetISa argument. Fix the return_at_end verifier tests which no longer require an ISA specified. The signle "set return_at_end" flag setting now makes it to the verifier even when no ISA is present to carry it.
This commit is contained in:
@@ -427,9 +427,10 @@ impl DominatorTree {
|
||||
mod test {
|
||||
use cursor::{Cursor, FuncCursor};
|
||||
use flowgraph::ControlFlowGraph;
|
||||
use ir::{Function, InstBuilder, types};
|
||||
use super::*;
|
||||
use ir::types::*;
|
||||
use ir::{Function, InstBuilder, types};
|
||||
use settings;
|
||||
use super::*;
|
||||
use verifier::verify_context;
|
||||
|
||||
#[test]
|
||||
@@ -608,6 +609,8 @@ mod test {
|
||||
dt.recompute_split_ebb(ebb3, ebb4, middle_jump_inst);
|
||||
|
||||
cfg.compute(cur.func);
|
||||
verify_context(cur.func, &cfg, &dt, None).unwrap();
|
||||
|
||||
let flags = settings::Flags::new(&settings::builder());
|
||||
verify_context(cur.func, &cfg, &dt, &flags).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user