]> git.lizzy.rs Git - rust.git/commitdiff
Don't translate intrinsic func operand
authorbjorn3 <bjorn3@users.noreply.github.com>
Sat, 11 Aug 2018 12:24:05 +0000 (14:24 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Sat, 11 Aug 2018 12:24:05 +0000 (14:24 +0200)
src/abi.rs

index 0e4f6c15b156aba4e1b608608c17c6741746afdc..6eae368eced1cf22f5c4faa60d42300ed9fc4e55 100644 (file)
@@ -421,8 +421,7 @@ pub fn codegen_call<'a, 'tcx: 'a>(
     args: &[Operand<'tcx>],
     destination: &Option<(Place<'tcx>, BasicBlock)>,
 ) {
-    let func = trans_operand(fx, func);
-    let fn_ty = func.layout().ty;
+    let fn_ty = fx.monomorphize(&func.ty(&fx.mir.local_decls, fx.tcx));
     let sig = ty_fn_sig(fx.tcx, fn_ty);
 
     // Unpack arguments tuple for closures
@@ -483,7 +482,7 @@ pub fn codegen_call<'a, 'tcx: 'a>(
             }
         })).collect::<Vec<_>>();
 
-    let inst = match func {
+    let inst = match trans_operand(fx, func) {
         CValue::Func(func, _) => fx.bcx.ins().call(func, &call_args),
         func => {
             let func = func.load_value(fx);
@@ -538,7 +537,6 @@ fn codegen_intrinsic_call<'a, 'tcx: 'a>(
             let ret = match destination {
                 Some((place, _)) => place,
                 None => {
-                    println!("codegen_call(fx, _, {:?}, {:?})", args, destination);
                     // Insert non returning intrinsics here
                     match intrinsic {
                         "abort" => {