summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_codegen_cranelift/src/base.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/base.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index fcfa0b862..334b2780b 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -2,7 +2,7 @@
use rustc_ast::InlineAsmOptions;
use rustc_index::IndexVec;
-use rustc_middle::ty::adjustment::PointerCast;
+use rustc_middle::ty::adjustment::PointerCoercion;
use rustc_middle::ty::layout::FnAbiOf;
use rustc_middle::ty::print::with_no_trimmed_paths;
@@ -156,6 +156,7 @@ pub(crate) fn compile_fn(
write!(clif, " {}", isa_flag).unwrap();
}
writeln!(clif, "\n").unwrap();
+ writeln!(clif, "; symbol {}", codegened_func.symbol_name).unwrap();
crate::PrintOnPanic(move || {
let mut clif = clif.clone();
::cranelift_codegen::write::decorate_function(
@@ -420,7 +421,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
target,
fn_span,
unwind: _,
- from_hir_call: _,
+ call_source: _,
} => {
fx.tcx.prof.generic_activity("codegen call").run(|| {
crate::abi::codegen_terminator_call(
@@ -570,7 +571,7 @@ fn codegen_stmt<'tcx>(
lval.write_cvalue(fx, res);
}
Rvalue::Cast(
- CastKind::Pointer(PointerCast::ReifyFnPointer),
+ CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer),
ref operand,
to_ty,
) => {
@@ -595,17 +596,17 @@ fn codegen_stmt<'tcx>(
}
}
Rvalue::Cast(
- CastKind::Pointer(PointerCast::UnsafeFnPointer),
+ CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer),
ref operand,
to_ty,
)
| Rvalue::Cast(
- CastKind::Pointer(PointerCast::MutToConstPointer),
+ CastKind::PointerCoercion(PointerCoercion::MutToConstPointer),
ref operand,
to_ty,
)
| Rvalue::Cast(
- CastKind::Pointer(PointerCast::ArrayToPointer),
+ CastKind::PointerCoercion(PointerCoercion::ArrayToPointer),
ref operand,
to_ty,
) => {
@@ -661,7 +662,7 @@ fn codegen_stmt<'tcx>(
}
}
Rvalue::Cast(
- CastKind::Pointer(PointerCast::ClosureFnPointer(_)),
+ CastKind::PointerCoercion(PointerCoercion::ClosureFnPointer(_)),
ref operand,
_to_ty,
) => {
@@ -683,7 +684,11 @@ fn codegen_stmt<'tcx>(
_ => bug!("{} cannot be cast to a fn ptr", operand.layout().ty),
}
}
- Rvalue::Cast(CastKind::Pointer(PointerCast::Unsize), ref operand, _to_ty) => {
+ Rvalue::Cast(
+ CastKind::PointerCoercion(PointerCoercion::Unsize),
+ ref operand,
+ _to_ty,
+ ) => {
let operand = codegen_operand(fx, operand);
crate::unsize::coerce_unsized_into(fx, operand, lval);
}
@@ -705,7 +710,6 @@ fn codegen_stmt<'tcx>(
let times = fx
.monomorphize(times)
.eval(fx.tcx, ParamEnv::reveal_all())
- .kind()
.try_to_bits(fx.tcx.data_layout.pointer_size)
.unwrap();
if operand.layout().size.bytes() == 0 {
@@ -746,7 +750,7 @@ fn codegen_stmt<'tcx>(
}
Rvalue::ShallowInitBox(ref operand, content_ty) => {
let content_ty = fx.monomorphize(content_ty);
- let box_layout = fx.layout_of(fx.tcx.mk_box(content_ty));
+ let box_layout = fx.layout_of(Ty::new_box(fx.tcx, content_ty));
let operand = codegen_operand(fx, operand);
let operand = operand.load_scalar(fx);
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
@@ -887,7 +891,7 @@ pub(crate) fn codegen_place<'tcx>(
let ptr = cplace.to_ptr();
cplace = CPlace::for_ptr(
ptr.offset_i64(fx, elem_layout.size.bytes() as i64 * (from as i64)),
- fx.layout_of(fx.tcx.mk_array(*elem_ty, to - from)),
+ fx.layout_of(Ty::new_array(fx.tcx, *elem_ty, to - from)),
);
}
ty::Slice(elem_ty) => {