mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +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) {
|
fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
|
||||||
let opts = sess.get_opts();
|
let opts = sess.get_opts();
|
||||||
if opts.time_llvm_passes { llvm::LLVMRustEnableTimePasses(); }
|
if opts.time_llvm_passes { llvm::LLVMRustEnableTimePasses(); }
|
||||||
|
if opts.stack_growth { llvm::LLVMRustEnableSegmentedStacks(); }
|
||||||
link_intrinsics(sess, llmod);
|
link_intrinsics(sess, llmod);
|
||||||
let pm = mk_pass_manager();
|
let pm = mk_pass_manager();
|
||||||
let td = mk_target_data(x86::get_data_layout());
|
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. */
|
/** Turn on LLVM pass-timing. */
|
||||||
fn LLVMRustEnableTimePasses();
|
fn LLVMRustEnableTimePasses();
|
||||||
|
/** Turn on LLVM segmented stacks. */
|
||||||
|
fn LLVMRustEnableSegmentedStacks();
|
||||||
|
|
||||||
/** Print the pass timings since static dtors aren't picking them up. */
|
/** Print the pass timings since static dtors aren't picking them up. */
|
||||||
fn LLVMRustPrintPassTimings();
|
fn LLVMRustPrintPassTimings();
|
||||||
|
@ -123,3 +123,9 @@ extern "C" void LLVMRustPrintPassTimings() {
|
|||||||
raw_fd_ostream OS (2, false); // stderr.
|
raw_fd_ostream OS (2, false); // stderr.
|
||||||
TimerGroup::printAll(OS);
|
TimerGroup::printAll(OS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool llvm::EnableSegmentedStacks;
|
||||||
|
extern "C" void LLVMRustEnableSegmentedStacks() {
|
||||||
|
EnableSegmentedStacks = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ LLVMRustGetHostTriple
|
|||||||
LLVMRustConstSmallInt
|
LLVMRustConstSmallInt
|
||||||
LLVMRustParseBitcode
|
LLVMRustParseBitcode
|
||||||
LLVMRustPrintPassTimings
|
LLVMRustPrintPassTimings
|
||||||
|
LLVMRustEnableSegmentedStacks
|
||||||
LLVMLinkModules
|
LLVMLinkModules
|
||||||
LLVMCreateObjectFile
|
LLVMCreateObjectFile
|
||||||
LLVMDisposeObjectFile
|
LLVMDisposeObjectFile
|
||||||
|
Loading…
Reference in New Issue
Block a user