@@ -448,36 +448,23 @@ pub fn set_inline_hint(f: ValueRef) {
448
448
lib:: llvm:: SetFunctionAttribute ( f, lib:: llvm:: InlineHintAttribute )
449
449
}
450
450
451
- pub fn set_llvm_fn_attrs ( attrs : & [ ast:: Attribute ] , llfn : ValueRef ) {
451
+ pub fn set_inline_hint_if_appr ( attrs : & [ ast:: Attribute ] ,
452
+ llfn : ValueRef ) {
452
453
use syntax:: attr:: * ;
453
- // Set the inline hint if there is one
454
454
match find_inline_attr ( attrs) {
455
455
InlineHint => set_inline_hint ( llfn) ,
456
456
InlineAlways => set_always_inline ( llfn) ,
457
457
InlineNever => set_no_inline ( llfn) ,
458
458
InlineNone => { /* fallthrough */ }
459
459
}
460
-
461
- // Add the no-split-stack attribute if requested
462
- if contains_name ( attrs, "no_split_stack" ) {
463
- set_no_split_stack ( llfn) ;
464
- }
465
460
}
466
461
467
462
pub fn set_always_inline ( f : ValueRef ) {
468
463
lib:: llvm:: SetFunctionAttribute ( f, lib:: llvm:: AlwaysInlineAttribute )
469
464
}
470
465
471
466
pub fn set_fixed_stack_segment ( f : ValueRef ) {
472
- do "fixed-stack-segment" . to_c_str ( ) . with_ref |buf| {
473
- unsafe { llvm:: LLVMAddFunctionAttrString ( f, buf) ; }
474
- }
475
- }
476
-
477
- pub fn set_no_split_stack ( f : ValueRef ) {
478
- do "no-split-stack" . to_c_str ( ) . with_ref |buf| {
479
- unsafe { llvm:: LLVMAddFunctionAttrString ( f, buf) ; }
480
- }
467
+ lib:: llvm:: SetFixedStackSegmentAttribute ( f) ;
481
468
}
482
469
483
470
pub fn set_glue_inlining ( f : ValueRef , t : ty:: t ) {
@@ -2504,7 +2491,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
2504
2491
sym,
2505
2492
i. id )
2506
2493
} ;
2507
- set_llvm_fn_attrs ( i. attrs , llfn) ;
2494
+ set_inline_hint_if_appr ( i. attrs , llfn) ;
2508
2495
llfn
2509
2496
}
2510
2497
@@ -2637,7 +2624,7 @@ pub fn register_method(ccx: @mut CrateContext,
2637
2624
let sym = exported_name ( ccx, path, mty, m. attrs ) ;
2638
2625
2639
2626
let llfn = register_fn ( ccx, m. span , sym, id, mty) ;
2640
- set_llvm_fn_attrs ( m. attrs , llfn) ;
2627
+ set_inline_hint_if_appr ( m. attrs , llfn) ;
2641
2628
llfn
2642
2629
}
2643
2630
0 commit comments