mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
rustc: Enable segmented stacks in LLVM when --stack-growth is on
This commit is contained in:
parent
c9003d301f
commit
329f045d4c
@ -91,6 +91,7 @@ mod write {
|
||||
fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
|
||||
let opts = sess.get_opts();
|
||||
if opts.time_llvm_passes { llvm::LLVMRustEnableTimePasses(); }
|
||||
if opts.stack_growth { llvm::LLVMRustEnableSegmentedStacks(); }
|
||||
link_intrinsics(sess, llmod);
|
||||
let pm = mk_pass_manager();
|
||||
let td = mk_target_data(x86::get_data_layout());
|
||||
|
@ -868,6 +868,8 @@ native "c-stack-cdecl" mod llvm = "rustllvm" {
|
||||
|
||||
/** Turn on LLVM pass-timing. */
|
||||
fn LLVMRustEnableTimePasses();
|
||||
/** Turn on LLVM segmented stacks. */
|
||||
fn LLVMRustEnableSegmentedStacks();
|
||||
|
||||
/** Print the pass timings since static dtors aren't picking them up. */
|
||||
fn LLVMRustPrintPassTimings();
|
||||
|
@ -123,3 +123,9 @@ extern "C" void LLVMRustPrintPassTimings() {
|
||||
raw_fd_ostream OS (2, false); // stderr.
|
||||
TimerGroup::printAll(OS);
|
||||
}
|
||||
|
||||
extern bool llvm::EnableSegmentedStacks;
|
||||
extern "C" void LLVMRustEnableSegmentedStacks() {
|
||||
EnableSegmentedStacks = true;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ LLVMRustGetHostTriple
|
||||
LLVMRustConstSmallInt
|
||||
LLVMRustParseBitcode
|
||||
LLVMRustPrintPassTimings
|
||||
LLVMRustEnableSegmentedStacks
|
||||
LLVMLinkModules
|
||||
LLVMCreateObjectFile
|
||||
LLVMDisposeObjectFile
|
||||
|
Loading…
Reference in New Issue
Block a user