From 4901a66df16d2bd75444fb79e76b9bee167f7f83 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Mon, 30 Jul 2018 16:02:26 +0200 Subject: [PATCH] Implement intrinsics assume and (un)likely --- src/abi.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/abi.rs b/src/abi.rs index f2e6007e5f8..70af157e47c 100644 --- a/src/abi.rs +++ b/src/abi.rs @@ -298,6 +298,13 @@ pub fn codegen_call<'a, 'tcx: 'a>( "abort" => { fx.bcx.ins().trap(TrapCode::User(!0 - 1)); } + "assume" => { + assert_eq!(args.len(), 1); + } + "likely" | "unlikely" => { + assert_eq!(args.len(), 1); + ret.write_cvalue(fx, args[0]); + } "copy" | "copy_nonoverlapping" => { let elem_ty = substs.type_at(0); let elem_size: u64 = fx.layout_of(elem_ty).size.bytes();