@@ -1772,11 +1772,17 @@ fn lval_no_env(bcx: block, val: ValueRef, kind: lval_kind)
1772
1772
fn trans_external_path ( ccx : @crate_ctxt , did : ast:: def_id , t : ty:: t )
1773
1773
-> ValueRef {
1774
1774
let name = csearch:: get_symbol ( ccx. sess . cstore , did) ;
1775
- let llty = alt ty:: get ( t) . struct {
1776
- ty:: ty_fn ( _) { type_of_fn_from_ty ( ccx, t) }
1777
- _ { type_of( ccx, t) }
1775
+ alt ty:: get ( t) . struct {
1776
+ ty:: ty_fn ( _) {
1777
+ let llty = type_of_fn_from_ty ( ccx, t) ;
1778
+ ret get_extern_fn ( ccx. externs , ccx. llmod , name,
1779
+ lib:: llvm:: CCallConv , llty) ;
1780
+ }
1781
+ _ {
1782
+ let llty = type_of ( ccx, t) ;
1783
+ ret get_extern_const ( ccx. externs , ccx. llmod , name, llty) ;
1784
+ }
1778
1785
} ;
1779
- ret get_extern_const ( ccx. externs , ccx. llmod , name, llty) ;
1780
1786
}
1781
1787
1782
1788
fn normalize_for_monomorphization ( tcx : ty:: ctxt , ty : ty:: t ) -> option < ty:: t > {
@@ -4498,6 +4504,7 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
4498
4504
let start_ty = T_fn ( [ val_ty ( rust_main) , ccx. int_type , ccx. int_type ,
4499
4505
val_ty ( crate_map) ] , ccx. int_type ) ;
4500
4506
let start = decl_cdecl_fn ( ccx. llmod , "rust_start" , start_ty) ;
4507
+
4501
4508
let args = [ rust_main, llvm:: LLVMGetParam ( llfn, 0 as c_uint ) ,
4502
4509
llvm:: LLVMGetParam ( llfn, 1 as c_uint ) , crate_map] ;
4503
4510
let result = unsafe {
0 commit comments