Revert some changes

This commit is contained in:
bjorn3 2019-12-31 15:59:49 +01:00
parent dbb118a5bc
commit 4c7abd504c
4 changed files with 20 additions and 14 deletions

View File

@ -394,10 +394,6 @@ pub trait FnMut<Args>: FnOnce<Args> {
#[lang = "panic"]
pub fn panic(&(_msg, _file, _line, _col): &(&'static str, &'static str, u32, u32)) -> ! {
panic_inner(&_msg);
}
pub fn panic_inner(_msg: &&str) -> ! {
unsafe {
libc::puts("Panicking\0" as *const str as *const u8);
intrinsics::abort();

View File

@ -269,7 +269,7 @@ fn trans_stmt<'tcx>(
fx.set_debug_loc(stmt.source_info);
#[cfg(false_debug_assertions)]
#[cfg(debug_assertions)]
match &stmt.kind {
StatementKind::StorageLive(..) | StatementKind::StorageDead(..) => {} // Those are not very useful
_ => {

View File

@ -362,6 +362,19 @@ impl<'tcx> CPlace<'tcx> {
}
pub fn write_cvalue(self, fx: &mut FunctionCx<'_, 'tcx, impl Backend>, from: CValue<'tcx>) {
#[cfg(debug_assertions)]
{
use cranelift_codegen::cursor::{Cursor, CursorPosition};
let cur_ebb = match fx.bcx.cursor().position() {
CursorPosition::After(ebb) => ebb,
_ => unreachable!(),
};
fx.add_comment(
fx.bcx.func.layout.last_inst(cur_ebb).unwrap(),
format!("write_cvalue: {:?} <- {:?}",self, from),
);
}
let from_ty = from.layout().ty;
let to_ty = self.layout().ty;

15
test.sh
View File

@ -4,10 +4,10 @@ set -e
if [[ "$1" == "--release" ]]; then
export CHANNEL='release'
cargo rustc --release $CG_CLIF_COMPILE_FLAGS -- -Clink-args=-fuse-ld=lld
cargo build --release $CG_CLIF_COMPILE_FLAGS
else
export CHANNEL='debug'
cargo rustc $CG_CLIF_COMPILE_FLAGS -- -Clink-args=-fuse-ld=lld
cargo build $CG_CLIF_COMPILE_FLAGS
fi
source config.sh
@ -28,8 +28,6 @@ mkdir -p target/out/clif
echo "[BUILD] mini_core"
$RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib
#exit 1
echo "[BUILD] example"
$RUSTC example/example.rs --crate-type lib
@ -71,16 +69,15 @@ $RUSTC example/mod_bench.rs --crate-type bin
pushd simple-raytracer
echo "[BENCH COMPILE] ebobby/simple-raytracer"
rm -r target/x86_64*/
../cargo.sh build
hyperfine --runs ${RUN_RUNS:-10} --warmup 1 --prepare "rm -r target/*/debug || true" \
"RUSTFLAGS='' cargo build --target $TARGET_TRIPLE" \
"../cargo.sh build"
echo "[BENCH RUN] ebobby/simple-raytracer"
cp ./target/*/debug/main ./raytracer_cg_clif
hyperfine --runs ${RUN_RUNS:-10} ./raytracer_*
hyperfine --runs ${RUN_RUNS:-10} ./raytracer_cg_llvm ./raytracer_cg_clif
popd
exit 1
pushd build_sysroot/sysroot_src/src/libcore/tests
rm -r ./target || true
../../../../../cargo.sh test