Update opt name in CompilerConfig, enable IR verification in spectests

This commit is contained in:
Mark McCaskey
2020-03-24 15:46:58 -07:00
parent 403e14bc1e
commit ce1b1f67cf
3 changed files with 41 additions and 9 deletions

View File

@ -106,7 +106,7 @@ impl BackendCompilerConfig {
}
/// Configuration data for the compiler
#[derive(Debug, Default)]
#[derive(Debug)]
pub struct CompilerConfig {
/// Symbol information generated from emscripten; used for more detailed debug messages
pub symbol_map: Option<HashMap<u32, String>>,
@ -136,11 +136,12 @@ pub struct CompilerConfig {
/// Enabling this makes execution deterministic but increases runtime overhead.
pub nan_canonicalization: bool,
/// Turns off verification that is done by default when `debug_assertions` are enabled
/// (for example in 'debug' builds). Enabling this flag will make compilation faster at the
/// cost of not detecting bugs in the compiler. The verification steps that this flag
/// disables are disabled by default in 'release' builds.
pub disable_debug_mode_verification: bool,
/// Turns on verification that is done by default when `debug_assertions` are enabled
/// (for example in 'debug' builds). Disabling this flag will make compilation faster
/// in debug mode at the cost of not detecting bugs in the compiler.
///
/// These verifications are disabled by default in 'release' builds.
pub enable_verification: bool,
pub features: Features,
@ -154,6 +155,30 @@ pub struct CompilerConfig {
pub generate_debug_info: bool,
}
impl Default for CompilerConfig {
fn default() -> Self {
Self {
symbol_map: Default::default(),
memory_bound_check_mode: Default::default(),
enforce_stack_check: Default::default(),
track_state: Default::default(),
full_preemption: Default::default(),
nan_canonicalization: Default::default(),
features: Default::default(),
triple: Default::default(),
cpu_name: Default::default(),
cpu_features: Default::default(),
backend_specific_config: Default::default(),
generate_debug_info: Default::default(),
// Default verification to 'on' when testing or running in debug mode.
// NOTE: cfg(test) probably does nothing when not running `cargo test`
// on this crate
enable_verification: cfg!(test) || cfg!(debug_assertions),
}
}
}
impl CompilerConfig {
/// Use this to check if we should be generating debug information.
/// This function takes into account the features that runtime-core was