Implement intrinsics assume and (un)likely
This commit is contained in:
parent
dc3ec67046
commit
4901a66df1
1 changed files with 7 additions and 0 deletions
|
@ -298,6 +298,13 @@ pub fn codegen_call<'a, 'tcx: 'a>(
|
||||||
"abort" => {
|
"abort" => {
|
||||||
fx.bcx.ins().trap(TrapCode::User(!0 - 1));
|
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" => {
|
"copy" | "copy_nonoverlapping" => {
|
||||||
let elem_ty = substs.type_at(0);
|
let elem_ty = substs.type_at(0);
|
||||||
let elem_size: u64 = fx.layout_of(elem_ty).size.bytes();
|
let elem_size: u64 = fx.layout_of(elem_ty).size.bytes();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue