@@ -204,8 +204,8 @@ fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
204
204
// Function addresses in Rust are never significant, allowing functions to be merged.
205
205
llvm:: SetUnnamedAddr ( llfn, true ) ;
206
206
207
- if ccx. is_split_stack_supported ( ) {
208
- set_split_stack ( llfn) ;
207
+ if ccx. is_probe_stack_supported ( ) {
208
+ set_probe_stack ( llfn) ;
209
209
}
210
210
211
211
llfn
@@ -429,11 +429,6 @@ pub fn set_llvm_fn_attrs(attrs: &[ast::Attribute], llfn: ValueRef) {
429
429
InlineNone => { /* fallthrough */ }
430
430
}
431
431
432
- // Add the no-split-stack attribute if requested
433
- if contains_name ( attrs, "no_split_stack" ) {
434
- unset_split_stack ( llfn) ;
435
- }
436
-
437
432
if contains_name ( attrs, "cold" ) {
438
433
unsafe {
439
434
llvm:: LLVMAddFunctionAttribute ( llfn,
@@ -447,14 +442,14 @@ pub fn set_always_inline(f: ValueRef) {
447
442
llvm:: SetFunctionAttribute ( f, llvm:: AlwaysInlineAttribute )
448
443
}
449
444
450
- pub fn set_split_stack ( f : ValueRef ) {
451
- "split -stack" . with_c_str ( |buf| {
445
+ pub fn set_probe_stack ( f : ValueRef ) {
446
+ "probe -stack" . with_c_str ( |buf| {
452
447
unsafe { llvm:: LLVMAddFunctionAttrString ( f, llvm:: FunctionIndex as c_uint , buf) ; }
453
448
} )
454
449
}
455
450
456
- pub fn unset_split_stack ( f : ValueRef ) {
457
- "split -stack" . with_c_str ( |buf| {
451
+ pub fn unset_probe_stack ( f : ValueRef ) {
452
+ "probe -stack" . with_c_str ( |buf| {
458
453
unsafe { llvm:: LLVMRemoveFunctionAttrString ( f, llvm:: FunctionIndex as c_uint , buf) ; }
459
454
} )
460
455
}
@@ -2009,14 +2004,8 @@ fn finish_register_fn(ccx: &CrateContext, sp: Span, sym: String, node_id: ast::N
2009
2004
llvm:: SetLinkage ( llfn, llvm:: InternalLinkage ) ;
2010
2005
}
2011
2006
2012
- // The stack exhaustion lang item shouldn't have a split stack because
2013
- // otherwise it would continue to be exhausted (bad), and both it and the
2014
- // eh_personality functions need to be externally linkable.
2007
+ // The eh_personality function need to be externally linkable.
2015
2008
let def = ast_util:: local_def( node_id) ;
2016
- if ccx. tcx. lang_items. stack_exhausted( ) == Some ( def) {
2017
- unset_split_stack( llfn) ;
2018
- llvm:: SetLinkage ( llfn, llvm:: ExternalLinkage ) ;
2019
- }
2020
2009
if ccx. tcx. lang_items. eh_personality( ) == Some ( def) {
2021
2010
llvm:: SetLinkage ( llfn, llvm:: ExternalLinkage ) ;
2022
2011
}
@@ -2729,13 +2718,9 @@ pub fn trans_crate(krate: ast::Crate,
2729
2718
} ) ;
2730
2719
2731
2720
// Make sure that some other crucial symbols are not eliminated from the
2732
- // module. This includes the main function, the crate map (used for debug
2733
- // log settings and I/O), and finally the curious rust_stack_exhausted
2734
- // symbol. This symbol is required for use by the libmorestack library that
2735
- // we link in, so we must ensure that this symbol is not internalized (if
2736
- // defined in the crate).
2721
+ // module. This includes the main function and the crate map (used for debug
2722
+ // log settings and I/O)
2737
2723
reachable. push( "main" . to_string( ) ) ;
2738
- reachable. push( "rust_stack_exhausted" . to_string( ) ) ;
2739
2724
2740
2725
// referenced from .eh_frame section on some platforms
2741
2726
reachable. push( "rust_eh_personality" . to_string( ) ) ;
0 commit comments