Disable define_function to prevent crashing on things cranelift doesn't yet support
This commit is contained in:
parent
9615f3a137
commit
9a9054ad23
3 changed files with 26 additions and 21 deletions
|
@ -1,5 +1,6 @@
|
||||||
#![feature(no_core, lang_items)]
|
#![feature(no_core, lang_items)]
|
||||||
#![no_core]
|
#![no_core]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#[lang="sized"]
|
#[lang="sized"]
|
||||||
trait Sized {}
|
trait Sized {}
|
||||||
|
@ -52,14 +53,14 @@ fn bcd(b: bool, a: u8) -> u8 {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME make calls work
|
// FIXME make calls work
|
||||||
/*fn call() {
|
fn call() {
|
||||||
abc(42);
|
abc(42);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn indirect_call() {
|
fn indirect_call() {
|
||||||
let f: fn() = call;
|
let f: fn() = call;
|
||||||
f();
|
f();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
enum BoolOption {
|
enum BoolOption {
|
||||||
Some(bool),
|
Some(bool),
|
||||||
|
|
|
@ -50,7 +50,9 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(cx: &mut CodegenCx<'a, 'tcx, CurrentBackend
|
||||||
}
|
}
|
||||||
|
|
||||||
context.func = f;
|
context.func = f;
|
||||||
cx.module.define_function(func_id, context).unwrap();
|
// TODO: cranelift doesn't yet support some of the things needed
|
||||||
|
// cx.module.define_function(func_id, context).unwrap();
|
||||||
|
|
||||||
context.clear();
|
context.clear();
|
||||||
}
|
}
|
||||||
inst => cx.tcx.sess.warn(&format!("Unimplemented instance {:?}", inst)),
|
inst => cx.tcx.sess.warn(&format!("Unimplemented instance {:?}", inst)),
|
||||||
|
|
|
@ -192,8 +192,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
|
|
||||||
tcx.sess.warn("Compiled everything");
|
tcx.sess.warn("Compiled everything");
|
||||||
|
|
||||||
|
// TODO: this doesn't work most of the time
|
||||||
|
if false {
|
||||||
module.finalize_all();
|
module.finalize_all();
|
||||||
|
|
||||||
tcx.sess.warn("Finalized everything");
|
tcx.sess.warn("Finalized everything");
|
||||||
|
|
||||||
for (inst, func_id) in def_id_fn_id_map.iter() {
|
for (inst, func_id) in def_id_fn_id_map.iter() {
|
||||||
|
@ -213,6 +214,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.finish();
|
module.finish();
|
||||||
|
}
|
||||||
|
|
||||||
tcx.sess.fatal("unimplemented");
|
tcx.sess.fatal("unimplemented");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue