This commit is contained in:
bjorn3 2018-08-08 19:33:37 +02:00
parent 7b29b4cec1
commit 5b85e0fec8
2 changed files with 10 additions and 12 deletions

View File

@ -290,7 +290,9 @@ pub fn codegen_call<'a, 'tcx: 'a>(
let fn_ty = func.layout().ty;
let sig = ty_fn_sig(fx.tcx, fn_ty);
let return_place = destination.as_ref().map(|(place, _)| trans_place(fx, place));
let return_place = destination
.as_ref()
.map(|(place, _)| trans_place(fx, place));
// Unpack arguments tuple for closures
let args = if sig.abi == Abi::RustCall {
@ -331,7 +333,10 @@ pub fn codegen_call<'a, 'tcx: 'a>(
let ret = match return_place {
Some(ret) => ret,
None => {
println!("codegen_call(fx, {:?}, {:?}, {:?})", func, args, destination);
println!(
"codegen_call(fx, {:?}, {:?}, {:?})",
func, args, destination
);
// Insert non returning intrinsics here
match intrinsic {
"abort" => {

View File

@ -231,11 +231,7 @@ pub fn trans_fn<'a, 'tcx: 'a>(
fx.comments.clone()
}
fn trans_stmt<'a, 'tcx: 'a>(
fx: &mut FunctionCx<'a, 'tcx>,
cur_ebb: Ebb,
stmt: &Statement<'tcx>,
) {
fn trans_stmt<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx>, cur_ebb: Ebb, stmt: &Statement<'tcx>) {
fx.tcx.sess.warn(&format!("stmt {:?}", stmt));
let inst = fx.bcx.func.layout.last_inst(cur_ebb).unwrap();
@ -825,11 +821,8 @@ pub fn trans_place<'a, 'tcx: 'a>(
if layout.is_unsized() {
unimpl!("Unsized places are not yet implemented");
}
CPlace::Addr(
base.to_cvalue(fx).load_value(fx),
layout,
)
},
CPlace::Addr(base.to_cvalue(fx).load_value(fx), layout)
}
ProjectionElem::Field(field, _ty) => base.place_field(fx, field),
ProjectionElem::Index(local) => {
let index = fx.get_local_place(local).to_cvalue(fx).load_value(fx);