rustc: Enable segmented stacks in LLVM when --stack-growth is on

This commit is contained in:
Patrick Walton 2011-10-31 14:42:17 -07:00
parent c9003d301f
commit 329f045d4c
4 changed files with 10 additions and 0 deletions

View File

@ -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());

View File

@ -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();

View File

@ -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;
}

View File

@ -6,6 +6,7 @@ LLVMRustGetHostTriple
LLVMRustConstSmallInt
LLVMRustParseBitcode
LLVMRustPrintPassTimings
LLVMRustEnableSegmentedStacks
LLVMLinkModules
LLVMCreateObjectFile
LLVMDisposeObjectFile