Move verify calls out of Context.
Also, move flowgraph() calls out of filetest and into the passes that need them so that filetest doesn't have embedded knowledge of these dependencies. This resolves a TODO about the way Context was running the verifier, and it makes the Context functions and the filetest runners more transparent. This also fixes simple_gvn to use the existing dominator tree rather than computing its own.
This commit is contained in:
@@ -10,7 +10,6 @@ use cretonne::loop_analysis::LoopAnalysis;
|
||||
use cretonne::flowgraph::ControlFlowGraph;
|
||||
use cretonne::dominator_tree::DominatorTree;
|
||||
use cretonne::Context;
|
||||
use cretonne::result::CtonError;
|
||||
use cretonne::verifier;
|
||||
use cretonne::settings::{self, Configurable};
|
||||
use std::fs::File;
|
||||
@@ -171,18 +170,10 @@ fn handle_module(
|
||||
context.loop_analysis = loop_analysis;
|
||||
verifier::verify_context(&context.func, &context.cfg, &context.domtree, None)
|
||||
.map_err(|err| pretty_verifier_error(&context.func, None, err))?;
|
||||
context.licm().map_err(|error| match error {
|
||||
CtonError::Verifier(err) => pretty_verifier_error(&context.func, None, err),
|
||||
CtonError::InvalidInput |
|
||||
CtonError::ImplLimitExceeded |
|
||||
CtonError::CodeTooLarge => String::from(error.description()),
|
||||
})?;
|
||||
context.simple_gvn().map_err(|error| match error {
|
||||
CtonError::Verifier(err) => pretty_verifier_error(&context.func, None, err),
|
||||
CtonError::InvalidInput |
|
||||
CtonError::ImplLimitExceeded |
|
||||
CtonError::CodeTooLarge => String::from(error.description()),
|
||||
})?;
|
||||
context.licm();
|
||||
verifier::verify_context(&context.func, &context.cfg, &context.domtree, None)
|
||||
.map_err(|err| pretty_verifier_error(&context.func, None, err))?;
|
||||
context.simple_gvn();
|
||||
verifier::verify_context(&context.func, &context.cfg, &context.domtree, None)
|
||||
.map_err(|err| pretty_verifier_error(&context.func, None, err))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user