Add a log for unimplemented stuff

This commit is contained in:
bjorn3 2018-08-09 15:30:26 +02:00
parent 48701d758d
commit a45f0ee6e3
2 changed files with 10 additions and 4 deletions

View File

@ -17,7 +17,7 @@ RUSTC="rustc -Zcodegen-backend=$(pwd)/../target/debug/librustc_codegen_cranelift
$RUSTC mini_core.rs --crate-name mini_core &&
$RUSTC example.rs &&
$RUSTC mini_core_hello_world.rs &&
$RUSTC ../target/libcore/src/libcore/lib.rs 2>&1 | (head -n 10; echo "===="; tail -n 1000) ||
(rm *.rlib; exit 1)
rm *.rlib
$RUSTC ../target/libcore/src/libcore/lib.rs 2>&1 | (head -n 10; echo "===="; tail -n 1000)
cat ../target/log.txt | sort | uniq -c | grep -v "rval unsize move" | grep -v "rval len"
rm *.rlib ../target/log.txt

View File

@ -242,12 +242,15 @@ impl CodegenBackend for CraneliftCodegenBackend {
let mut context = Context::new();
{
use std::io::Write;
let mut cx = CodegenCx {
tcx,
module: &mut module,
constants: HashMap::new(),
};
let mut log = ::std::fs::File::create("../target/log.txt").unwrap();
for mono_item in
collector::collect_crate_mono_items(tcx, collector::MonoItemCollectionMode::Eager).0
{
@ -258,7 +261,10 @@ impl CodegenBackend for CraneliftCodegenBackend {
}));
if let Err(err) = res {
match err.downcast::<NonFatal>() {
Ok(non_fatal) => tcx.sess.err(&non_fatal.0),
Ok(non_fatal) => {
writeln!(log, "{}", &non_fatal.0);
tcx.sess.err(&non_fatal.0)
}
Err(err) => ::std::panic::resume_unwind(err),
}
}