Rustfmt
This commit is contained in:
parent
509054d4de
commit
4da67855f1
3 changed files with 5 additions and 10 deletions
|
@ -7,8 +7,7 @@ use crate::prelude::*;
|
|||
|
||||
#[cfg(all(feature = "jit", unix))]
|
||||
#[no_mangle]
|
||||
static mut __cg_clif_global_atomic_mutex: libc::pthread_mutex_t =
|
||||
libc::PTHREAD_MUTEX_INITIALIZER;
|
||||
static mut __cg_clif_global_atomic_mutex: libc::pthread_mutex_t = libc::PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
pub(crate) fn init_global_lock(
|
||||
module: &mut impl Module,
|
||||
|
|
|
@ -499,7 +499,8 @@ fn codegen_stmt<'tcx>(
|
|||
UnOp::Neg => match layout.ty.kind() {
|
||||
ty::Int(IntTy::I128) => {
|
||||
// FIXME remove this case once ineg.i128 works
|
||||
let zero = CValue::const_val(fx, layout, ty::ScalarInt::null(layout.size));
|
||||
let zero =
|
||||
CValue::const_val(fx, layout, ty::ScalarInt::null(layout.size));
|
||||
crate::num::codegen_int_binop(fx, BinOp::Sub, zero, operand)
|
||||
}
|
||||
ty::Int(_) => CValue::by_val(fx.bcx.ins().ineg(val), layout),
|
||||
|
|
|
@ -163,10 +163,7 @@ pub(crate) fn codegen_const_value<'tcx>(
|
|||
assert!(!layout.is_unsized(), "sized const value");
|
||||
|
||||
if layout.is_zst() {
|
||||
return CValue::by_ref(
|
||||
crate::Pointer::dangling(layout.align.pref),
|
||||
layout,
|
||||
);
|
||||
return CValue::by_ref(crate::Pointer::dangling(layout.align.pref), layout);
|
||||
}
|
||||
|
||||
match const_val {
|
||||
|
@ -186,9 +183,7 @@ pub(crate) fn codegen_const_value<'tcx>(
|
|||
}
|
||||
|
||||
match x {
|
||||
Scalar::Int(int) => {
|
||||
CValue::const_val(fx, layout, int)
|
||||
}
|
||||
Scalar::Int(int) => CValue::const_val(fx, layout, int),
|
||||
Scalar::Ptr(ptr) => {
|
||||
let alloc_kind = fx.tcx.get_global_alloc(ptr.alloc_id);
|
||||
let base_addr = match alloc_kind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue