diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-11-17 15:02:57 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-11-17 15:02:57 +0100 |
| commit | 16334be18e50be2a66675a860e4d600c288ff34c (patch) | |
| tree | a0b4e7041b69ad085ec7908e843742047431284c | |
| parent | e3bbef764c6d2b8655a8d2f8540b5aaffa1924ef (diff) | |
| download | rust-16334be18e50be2a66675a860e4d600c288ff34c.tar.gz rust-16334be18e50be2a66675a860e4d600c288ff34c.zip | |
Remove a workaround for icmp.i8/i16 not having an encoding
| -rw-r--r-- | example/mini_core.rs | 4 | ||||
| -rw-r--r-- | src/base.rs | 13 |
2 files changed, 6 insertions, 11 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs index b8504a14771..83dd4f10f5e 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -1,4 +1,4 @@ -#![feature(no_core, lang_items, intrinsics, unboxed_closures)] +#![feature(no_core, lang_items, intrinsics, unboxed_closures, type_ascription)] #![no_core] #![allow(dead_code)] @@ -246,7 +246,7 @@ pub struct Box<T: ?Sized>(*mut T); impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {} -static mut MY_TINY_HEAP: [u8; 16] = [0; 16]; +static mut MY_TINY_HEAP: [u8; 16] = [0xff; 16]; #[lang = "exchange_malloc"] unsafe fn allocate(size: usize, _align: usize) -> *mut u8 { diff --git a/src/base.rs b/src/base.rs index 1be7942c84b..a4645ea7e01 100644 --- a/src/base.rs +++ b/src/base.rs @@ -18,7 +18,9 @@ pub fn trans_mono_item<'a, 'tcx: 'a>( ) { match mono_item { MonoItem::Fn(inst) => { - let _inst_guard = PrintOnPanic(|| format!("{:?}", inst)); + let _inst_guard = PrintOnPanic(|| { + format!("{:?} {}", inst, tcx.symbol_name(inst).as_str()) + }); let _mir_guard = PrintOnPanic(|| { match inst.def { InstanceDef::Item(_) @@ -761,14 +763,7 @@ macro_rules! binop_match { assert_eq!($fx.tcx.types.bool, $ret_ty); let ret_layout = $fx.layout_of($ret_ty); - // TODO HACK no encoding for icmp.i8 - use crate::common::clif_intcast; - let (lhs, rhs) = ( - clif_intcast($fx, $lhs, types::I64, $signed), - clif_intcast($fx, $rhs, types::I64, $signed), - ); - let b = $fx.bcx.ins().icmp(IntCC::$cc, lhs, rhs); - + let b = $fx.bcx.ins().icmp(IntCC::$cc, $lhs, $rhs); CValue::ByVal($fx.bcx.ins().bint(types::I8, b), ret_layout) }}; (@single $fx:expr, $bug_fmt:expr, $var:expr, $signed:expr, $lhs:expr, $rhs:expr, $ret_ty:expr, fcmp($cc:ident)) => {{ |
