@@ -317,18 +317,12 @@ fn decl_cdecl_fn(llmod: ModuleRef, name: str, llty: TypeRef) -> ValueRef {
317
317
ret decl_fn ( llmod, name, lib:: llvm:: LLVMCCallConv , llty) ;
318
318
}
319
319
320
- fn decl_fastcall_fn ( llmod : ModuleRef , name : str , llty : TypeRef ) -> ValueRef {
321
- let llfn = decl_fn ( llmod, name, lib:: llvm:: LLVMFastCallConv , llty) ;
322
- let _: ( ) = str:: as_buf ( "rust" , { |buf| llvm:: LLVMSetGC ( llfn, buf) } ) ;
323
- ret llfn;
324
- }
325
-
326
320
327
321
// Only use this if you are going to actually define the function. It's
328
322
// not valid to simply declare a function as internal.
329
- fn decl_internal_fastcall_fn ( llmod : ModuleRef , name : str , llty : TypeRef ) ->
323
+ fn decl_internal_cdecl_fn ( llmod : ModuleRef , name : str , llty : TypeRef ) ->
330
324
ValueRef {
331
- let llfn = decl_fastcall_fn ( llmod, name, llty) ;
325
+ let llfn = decl_cdecl_fn ( llmod, name, llty) ;
332
326
llvm:: LLVMSetLinkage ( llfn,
333
327
lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
334
328
ret llfn;
@@ -1454,7 +1448,7 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: ast::def_id,
1454
1448
( llvm:: LLVMGetElementType
1455
1449
( llvm:: LLVMTypeOf ( dtor_addr) ) ) [ std:: vec:: len ( args) ] ;
1456
1450
let val_cast = BitCast ( cx, val. val , val_llty) ;
1457
- FastCall ( cx, dtor_addr, args + [ val_cast] ) ;
1451
+ Call ( cx, dtor_addr, args + [ val_cast] ) ;
1458
1452
1459
1453
cx = drop_ty ( cx, val. val , inner_t_s) ;
1460
1454
Store ( cx, C_int ( 0 ) , drop_flag. val ) ;
@@ -2861,7 +2855,7 @@ fn trans_for_each(cx: @block_ctxt, local: @ast::local, seq: @ast::expr,
2861
2855
let iter_body_llty =
2862
2856
type_of_fn_from_ty ( ccx, cx. sp , iter_body_fn, 0 u) ;
2863
2857
let lliterbody: ValueRef =
2864
- decl_internal_fastcall_fn ( ccx. llmod , s, iter_body_llty) ;
2858
+ decl_internal_cdecl_fn ( ccx. llmod , s, iter_body_llty) ;
2865
2859
let fcx = new_fn_ctxt_w_id ( lcx, cx. sp , lliterbody, body. node . id ,
2866
2860
ast:: return_val) ;
2867
2861
fcx. iterbodyty = cx. fcx . iterbodyty ;
@@ -3418,8 +3412,7 @@ fn trans_bind_thunk(cx: @local_ctxt, sp: span, incoming_fty: ty::t,
3418
3412
// Give the thunk a name, type, and value.
3419
3413
let s: str = mangle_internal_name_by_path_and_seq ( ccx, cx. path , "thunk" ) ;
3420
3414
let llthunk_ty: TypeRef = get_pair_fn_ty ( type_of ( ccx, sp, incoming_fty) ) ;
3421
- let llthunk: ValueRef =
3422
- decl_internal_fastcall_fn ( ccx. llmod , s, llthunk_ty) ;
3415
+ let llthunk: ValueRef = decl_internal_cdecl_fn ( ccx. llmod , s, llthunk_ty) ;
3423
3416
3424
3417
// Create a new function context and block context for the thunk, and hold
3425
3418
// onto a pointer to the first block in the function for later use.
@@ -3559,7 +3552,7 @@ fn trans_bind_thunk(cx: @local_ctxt, sp: span, incoming_fty: ty::t,
3559
3552
let lltargetty =
3560
3553
type_of_fn_from_ty ( ccx, sp, outgoing_fty, ty_param_count) ;
3561
3554
lltargetfn = PointerCast ( bcx, lltargetfn, T_ptr ( lltargetty) ) ;
3562
- FastCall ( bcx, lltargetfn, llargs) ;
3555
+ Call ( bcx, lltargetfn, llargs) ;
3563
3556
build_return ( bcx) ;
3564
3557
finish_fn ( fcx, lltop) ;
3565
3558
ret { val : llthunk, ty : llthunk_ty} ;
@@ -3869,8 +3862,8 @@ fn trans_call(in_cx: @block_ctxt, f: @ast::expr,
3869
3862
type _|_. Since that means it diverges, the code
3870
3863
for the call itself is unreachable. */
3871
3864
let retval = C_nil ( ) ;
3872
- bcx = invoke_fastcall ( bcx, faddr, llargs,
3873
- args_res . to_zero , args_res. to_revoke ) ;
3865
+ bcx = invoke_full ( bcx, faddr, llargs, args_res . to_zero ,
3866
+ args_res. to_revoke ) ;
3874
3867
alt lliterbody {
3875
3868
none. {
3876
3869
if !ty:: type_is_nil ( tcx, ret_ty) {
@@ -3922,14 +3915,10 @@ fn invoke(bcx: @block_ctxt, llfn: ValueRef,
3922
3915
ret invoke_ ( bcx, llfn, llargs, [ ] , [ ] , Invoke ) ;
3923
3916
}
3924
3917
3925
- fn invoke_fastcall ( bcx : @block_ctxt , llfn : ValueRef ,
3926
- llargs : [ ValueRef ] ,
3927
- to_zero : [ { v : ValueRef , t : ty:: t } ] ,
3928
- to_revoke : [ { v : ValueRef , t : ty:: t } ] )
3929
- -> @block_ctxt {
3930
- ret invoke_ ( bcx, llfn, llargs,
3931
- to_zero, to_revoke,
3932
- FastInvoke ) ;
3918
+ fn invoke_full ( bcx : @block_ctxt , llfn : ValueRef , llargs : [ ValueRef ] ,
3919
+ to_zero : [ { v : ValueRef , t : ty:: t } ] ,
3920
+ to_revoke : [ { v : ValueRef , t : ty:: t } ] ) -> @block_ctxt {
3921
+ ret invoke_ ( bcx, llfn, llargs, to_zero, to_revoke, Invoke ) ;
3933
3922
}
3934
3923
3935
3924
fn invoke_ ( bcx : @block_ctxt , llfn : ValueRef , llargs : [ ValueRef ] ,
@@ -4129,7 +4118,7 @@ fn trans_expr(cx: @block_ctxt, e: @ast::expr) -> result {
4129
4118
type_of_fn_from_ty ( ccx, e. span , fty, 0 u) ;
4130
4119
let sub_cx = extend_path ( cx. fcx . lcx , ccx. names . next ( "anon" ) ) ;
4131
4120
let s = mangle_internal_name_by_path ( ccx, sub_cx. path ) ;
4132
- let llfn = decl_internal_fastcall_fn ( ccx. llmod , s, llfnty) ;
4121
+ let llfn = decl_internal_cdecl_fn ( ccx. llmod , s, llfnty) ;
4133
4122
4134
4123
let fn_res =
4135
4124
trans_closure ( some ( cx) , some ( llfnty) , sub_cx, e. span , f, llfn,
@@ -4580,7 +4569,7 @@ fn trans_put(in_cx: @block_ctxt, e: option::t<@ast::expr>) -> @block_ctxt {
4580
4569
llargs += [ r. val ] ;
4581
4570
}
4582
4571
}
4583
- bcx = invoke_fastcall ( bcx, llcallee, llargs, [ ] , [ ] ) ;
4572
+ bcx = invoke ( bcx, llcallee, llargs) ;
4584
4573
bcx = trans_block_cleanups ( bcx, cx) ;
4585
4574
let next_cx = new_sub_block_ctxt ( in_cx, "next" ) ;
4586
4575
if bcx. unreachable { Unreachable ( next_cx) ; }
@@ -5557,7 +5546,7 @@ fn register_fn_full(ccx: @crate_ctxt, sp: span, path: [str], _flav: str,
5557
5546
_ { ccx. sess . bug ( "register_fn(): fn item doesn't have fn type!" ) ; }
5558
5547
}
5559
5548
let ps: str = mangle_exported_name ( ccx, path, node_type) ;
5560
- let llfn: ValueRef = decl_fastcall_fn ( ccx. llmod , ps, llfty) ;
5549
+ let llfn: ValueRef = decl_cdecl_fn ( ccx. llmod , ps, llfty) ;
5561
5550
ccx. item_ids . insert ( node_id, llfn) ;
5562
5551
ccx. item_symbols . insert ( node_id, ps) ;
5563
5552
@@ -5594,7 +5583,8 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
5594
5583
5595
5584
let llfty = type_of_fn ( ccx, sp, ast:: proto_fn, false , false ,
5596
5585
[ vecarg_ty] , nt, 0 u) ;
5597
- let llfdecl = decl_fastcall_fn ( ccx. llmod , "_rust_main" , llfty) ;
5586
+ let llfdecl = decl_fn ( ccx. llmod , "_rust_main" ,
5587
+ lib:: llvm:: LLVMFastCallConv , llfty) ;
5598
5588
5599
5589
let fcx = new_fn_ctxt ( new_local_ctxt ( ccx) , sp, llfdecl) ;
5600
5590
@@ -5613,7 +5603,7 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
5613
5603
llargvarg = PointerCast ( bcx, llargvarg, minus_ptr) ;
5614
5604
args += [ do_spill_noroot ( bcx, llargvarg) ] ;
5615
5605
}
5616
- FastCall ( bcx, main_llfn, args) ;
5606
+ Call ( bcx, main_llfn, args) ;
5617
5607
build_return ( bcx) ;
5618
5608
5619
5609
finish_fn ( fcx, lltop) ;
@@ -5676,7 +5666,7 @@ fn register_native_fn(ccx: @crate_ctxt, sp: span, path: [str], name: str,
5676
5666
let t = node_id_type ( ccx, id) ;
5677
5667
let wrapper_type = native_fn_wrapper_type ( ccx, sp, num_ty_param, t) ;
5678
5668
let ps: str = mangle_exported_name ( ccx, path, node_id_type ( ccx, id) ) ;
5679
- let wrapper_fn = decl_fastcall_fn ( ccx. llmod , ps, wrapper_type) ;
5669
+ let wrapper_fn = decl_cdecl_fn ( ccx. llmod , ps, wrapper_type) ;
5680
5670
ccx. item_ids . insert ( id, wrapper_fn) ;
5681
5671
ccx. item_symbols . insert ( id, ps) ;
5682
5672
@@ -6048,7 +6038,7 @@ fn trap(bcx: @block_ctxt) {
6048
6038
6049
6039
fn decl_no_op_type_glue ( llmod : ModuleRef , taskptr_type : TypeRef ) -> ValueRef {
6050
6040
let ty = T_fn ( [ taskptr_type, T_ptr ( T_i8 ( ) ) ] , T_void ( ) ) ;
6051
- ret decl_fastcall_fn ( llmod, abi:: no_op_type_glue_name ( ) , ty) ;
6041
+ ret decl_cdecl_fn ( llmod, abi:: no_op_type_glue_name ( ) , ty) ;
6052
6042
}
6053
6043
6054
6044
fn make_glues ( llmod : ModuleRef , taskptr_type : TypeRef ) -> @glue_fns {
0 commit comments