Enable the IL verifier by default.
Change the default value for the "enable_verifier" setting so the verifier runs unless it is explicitly disabled. Most projects using Cretonne are best off running the verifier always until they start caring about compile time performance. Then they can easily disable the verifier.
This commit is contained in:
@@ -12,13 +12,9 @@ use utils::{pretty_error, read_to_string, parse_sets_and_isa};
|
|||||||
pub fn run(
|
pub fn run(
|
||||||
files: Vec<String>,
|
files: Vec<String>,
|
||||||
flag_print: bool,
|
flag_print: bool,
|
||||||
mut flag_set: Vec<String>,
|
flag_set: Vec<String>,
|
||||||
flag_isa: String,
|
flag_isa: String,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
// Enable the verifier by default, since we're reading IL in from a
|
|
||||||
// text file.
|
|
||||||
flag_set.insert(0, "enable_verifier=1".to_string());
|
|
||||||
|
|
||||||
let parsed = parse_sets_and_isa(flag_set, flag_isa)?;
|
let parsed = parse_sets_and_isa(flag_set, flag_isa)?;
|
||||||
|
|
||||||
for filename in files {
|
for filename in files {
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ enable_verifier = BoolSetting(
|
|||||||
|
|
||||||
This makes compilation slower but catches many bugs. The verifier is
|
This makes compilation slower but catches many bugs. The verifier is
|
||||||
disabled by default, except when reading Cretonne IL from a text file.
|
disabled by default, except when reading Cretonne IL from a text file.
|
||||||
""")
|
""",
|
||||||
|
default=True)
|
||||||
|
|
||||||
is_64bit = BoolSetting("Enable 64-bit code generation")
|
is_64bit = BoolSetting("Enable 64-bit code generation")
|
||||||
|
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ mod tests {
|
|||||||
f.to_string(),
|
f.to_string(),
|
||||||
"[shared]\n\
|
"[shared]\n\
|
||||||
opt_level = \"default\"\n\
|
opt_level = \"default\"\n\
|
||||||
enable_verifier = false\n\
|
enable_verifier = true\n\
|
||||||
is_64bit = false\n\
|
is_64bit = false\n\
|
||||||
return_at_end = false\n\
|
return_at_end = false\n\
|
||||||
is_compressed = false\n\
|
is_compressed = false\n\
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use cretonne::ir::immediates::{Imm64, Uimm32, Offset32, Ieee32, Ieee64};
|
|||||||
use cretonne::ir::entities::AnyEntity;
|
use cretonne::ir::entities::AnyEntity;
|
||||||
use cretonne::ir::instructions::{InstructionFormat, InstructionData, VariableArgs};
|
use cretonne::ir::instructions::{InstructionFormat, InstructionData, VariableArgs};
|
||||||
use cretonne::isa::{self, TargetIsa, Encoding, RegUnit};
|
use cretonne::isa::{self, TargetIsa, Encoding, RegUnit};
|
||||||
use cretonne::settings::{self, Configurable};
|
use cretonne::settings;
|
||||||
use testfile::{TestFile, Details, Comment};
|
use testfile::{TestFile, Details, Comment};
|
||||||
use error::{Location, Error, Result};
|
use error::{Location, Error, Result};
|
||||||
use lexer::{self, Lexer, Token};
|
use lexer::{self, Lexer, Token};
|
||||||
@@ -731,13 +731,6 @@ impl<'a> Parser<'a> {
|
|||||||
let mut isas = Vec::new();
|
let mut isas = Vec::new();
|
||||||
let mut flag_builder = settings::builder();
|
let mut flag_builder = settings::builder();
|
||||||
|
|
||||||
// Change the default for `enable_verifier` to `true`. It defaults to `false` because it
|
|
||||||
// would slow down normal compilation, but when we're reading IL from a text file we're
|
|
||||||
// either testing or debugging Cretonne, and verification makes sense.
|
|
||||||
flag_builder.enable("enable_verifier").expect(
|
|
||||||
"Missing enable_verifier setting",
|
|
||||||
);
|
|
||||||
|
|
||||||
while let Some(Token::Identifier(command)) = self.token() {
|
while let Some(Token::Identifier(command)) = self.token() {
|
||||||
match command {
|
match command {
|
||||||
"set" => {
|
"set" => {
|
||||||
|
|||||||
Reference in New Issue
Block a user