Code style tweaks.
This commit is contained in:
parent
84de8caa87
commit
4b242497d3
1 changed files with 35 additions and 36 deletions
|
@ -918,9 +918,10 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
|||
}
|
||||
|
||||
(_, _) => {
|
||||
match Intrinsic::find(tcx, &name) {
|
||||
let intr = match Intrinsic::find(tcx, &name) {
|
||||
Some(intr) => intr,
|
||||
None => ccx.sess().span_bug(foreign_item.span, "unknown intrinsic"),
|
||||
Some(intr) => {
|
||||
};
|
||||
fn ty_to_type(ccx: &CrateContext, t: &intrinsics::Type) -> Type {
|
||||
use intrinsics::Type::*;
|
||||
match *t {
|
||||
|
@ -950,8 +951,6 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if val_ty(llval) != Type::void(ccx) &&
|
||||
|
@ -1330,6 +1329,15 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
|
|||
call_debug_location: DebugLoc,
|
||||
call_info: NodeIdAndSpan) -> ValueRef
|
||||
{
|
||||
macro_rules! require {
|
||||
($cond: expr, $($fmt: tt)*) => {
|
||||
if !$cond {
|
||||
bcx.sess().span_err(call_info.span, &format!($($fmt)*));
|
||||
return C_null(llret_ty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let tcx = bcx.tcx();
|
||||
let arg_tys = match callee_ty.sty {
|
||||
ty::TyBareFn(_, ref f) => {
|
||||
|
@ -1348,15 +1356,6 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
|
|||
_ => None
|
||||
};
|
||||
|
||||
macro_rules! require {
|
||||
($cond: expr, $($fmt: tt)*) => {
|
||||
if !$cond {
|
||||
bcx.sess().span_err(call_info.span, &format!($($fmt)*));
|
||||
return C_null(llret_ty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(cmp_op) = comparison {
|
||||
assert_eq!(arg_tys.len(), 2);
|
||||
require!(arg_tys[0].is_simd(tcx),
|
||||
|
|
Loading…
Reference in a new issue