Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27

This commit is contained in:
bjorn3
2020-11-27 20:48:53 +01:00
33 changed files with 400 additions and 222 deletions

View File

@@ -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 {