@@ -2388,38 +2388,12 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
2388
2388
let et = ccx. sess . entry_type . unwrap ( ) ;
2389
2389
match et {
2390
2390
session:: EntryMain => {
2391
- let llfn = create_main ( ccx, main_llfn) ;
2392
- create_entry_fn ( ccx, llfn, true ) ;
2391
+ create_entry_fn ( ccx, main_llfn, true ) ;
2393
2392
}
2394
2393
session:: EntryStart => create_entry_fn ( ccx, main_llfn, false ) ,
2395
2394
session:: EntryNone => { } // Do nothing.
2396
2395
}
2397
2396
2398
- fn create_main ( ccx : @mut CrateContext , main_llfn : ValueRef ) -> ValueRef {
2399
- let nt = ty:: mk_nil ( ) ;
2400
- let llfty = type_of_rust_fn ( ccx, [ ] , nt) ;
2401
- let llfdecl = decl_fn ( ccx. llmod , "_rust_main" ,
2402
- lib:: llvm:: CCallConv , llfty) ;
2403
-
2404
- let fcx = new_fn_ctxt ( ccx, ~[ ] , llfdecl, nt, None ) ;
2405
-
2406
- // the args vector built in create_entry_fn will need
2407
- // be updated if this assertion starts to fail.
2408
- assert ! ( !fcx. caller_expects_out_pointer) ;
2409
-
2410
- let bcx = fcx. entry_bcx . unwrap ( ) ;
2411
- // Call main.
2412
- let llenvarg = unsafe {
2413
- let env_arg = fcx. env_arg_pos ( ) ;
2414
- llvm:: LLVMGetParam ( llfdecl, env_arg as c_uint )
2415
- } ;
2416
- let args = ~[ llenvarg] ;
2417
- Call ( bcx, main_llfn, args, [ ] ) ;
2418
-
2419
- finish_fn ( fcx, bcx) ;
2420
- return llfdecl;
2421
- }
2422
-
2423
2397
fn create_entry_fn ( ccx : @mut CrateContext ,
2424
2398
rust_main : ValueRef ,
2425
2399
use_start_lang_item : bool ) {
0 commit comments