]> git.lizzy.rs Git - rust.git/blobdiff - src/main_shim.rs
Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
[rust.git] / src / main_shim.rs
index db34d89fe2be717c5ce9ef1a2965ee10753aa5c9..b193cea877dad493996c9bbee8cf1a1011345bc3 100644 (file)
@@ -50,7 +50,7 @@ fn create_entry_fn(
         // late-bound regions, since late-bound
         // regions must appear in the argument
         // listing.
-        let main_ret_ty = tcx.erase_regions(&main_ret_ty.no_bound_vars().unwrap());
+        let main_ret_ty = tcx.erase_regions(main_ret_ty.no_bound_vars().unwrap());
 
         let cmain_sig = Signature {
             params: vec![
@@ -69,14 +69,14 @@ fn create_entry_fn(
 
         let instance = Instance::mono(tcx, rust_main_def_id).polymorphize(tcx);
 
-        let (main_name, main_sig) =
-            get_function_name_and_sig(tcx, m.isa().triple(), instance, false);
+        let main_name = tcx.symbol_name(instance).name.to_string();
+        let main_sig = get_function_sig(tcx, m.isa().triple(), instance);
         let main_func_id = m
             .declare_function(&main_name, Linkage::Import, &main_sig)
             .unwrap();
 
         let mut ctx = Context::new();
-        ctx.func = Function::with_name_signature(ExternalName::user(0, 0), cmain_sig.clone());
+        ctx.func = Function::with_name_signature(ExternalName::user(0, 0), cmain_sig);
         {
             let mut func_ctx = FunctionBuilderContext::new();
             let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);