add message about supported sanitizers

This commit is contained in:
Brendan Hansknecht 2022-12-15 14:43:52 -08:00
parent bf9a588acf
commit 1878250e36
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -253,6 +253,7 @@ fn gen_from_mono_module_llvm<'a>(
// It most likely will not work with other fuzzer setups without modification.
let mut passes = vec![];
let mut extra_args = vec![];
let mut unrecognized = vec![];
for sanitizer in std::env::var("ROC_SANITIZERS")
.unwrap()
.split(',')
@ -272,9 +273,17 @@ fn gen_from_mono_module_llvm<'a>(
// "-sanitizer-coverage-inline-8bit-counters",
]);
}
_ => {}
x => unrecognized.push(x.to_owned()),
}
}
if !unrecognized.is_empty() {
let out = unrecognized
.iter()
.map(|x| format!("{:?}", x))
.collect::<Vec<String>>()
.join(", ");
eprintln!("Unrecognized sanitizer: {}\nSupported options are \"address\", \"memory\", \"thread\", and \"fuzzer\"", out);
}
use std::process::Command;
let mut opt = Command::new("opt");