aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <[email protected]>2011-04-07 15:42:06 -0400
committerRafael Ávila de Espíndola <[email protected]>2011-04-07 15:42:06 -0400
commitb4422cca2195be788d99c849e662c3c778496739 (patch)
tree7e699c298714a46eaff380a8e501c3ad0cf3b1b4 /src/comp/middle
parentrustc: Reindent line. Puts out burning tinderbox. (diff)
downloadrust-b4422cca2195be788d99c849e662c3c778496739.tar.xz
rust-b4422cca2195be788d99c849e662c3c778496739.zip
Add a -O option and change the Makefile to use it.
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/trans.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 4f281b9c..f81c8e1d 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -7003,7 +7003,7 @@ fn make_glues(ModuleRef llmod, type_names tn) -> @glue_fns {
vec_append_glue = make_vec_append_glue(llmod, tn));
}
-fn make_common_glue(str output) {
+fn make_common_glue(str output, bool optimize) {
// FIXME: part of this is repetitive and is probably a good idea
// to autogen it, but things like the memcpy implementation are not
// and it might be better to just check in a .ll file.
@@ -7029,14 +7029,15 @@ fn make_common_glue(str output) {
trans_exit_task_glue(glues, new_str_hash[ValueRef](), tn, llmod);
- run_passes(llmod, true);
+ run_passes(llmod, optimize);
llvm.LLVMWriteBitcodeToFile(llmod, _str.buf(output));
llvm.LLVMDisposeModule(llmod);
}
fn trans_crate(session.session sess, @ast.crate crate,
- &ty.type_cache type_cache, str output, bool shared) {
+ &ty.type_cache type_cache, str output, bool shared,
+ bool optimize) {
auto llmod =
llvm.LLVMModuleCreateWithNameInContext(_str.buf("rust_out"),
llvm.LLVMGetGlobalContext());
@@ -7099,8 +7100,7 @@ fn trans_crate(session.session sess, @ast.crate crate,
// Translate the metadata.
middle.metadata.write_metadata(cx, crate);
- // FIXME: Add an -O option
- run_passes(llmod, true);
+ run_passes(llmod, optimize);
llvm.LLVMWriteBitcodeToFile(llmod, _str.buf(output));
llvm.LLVMDisposeModule(llmod);