rustc: Time the Rust translation and LLVM passes separately
This commit is contained in:
parent
a833f152ba
commit
ebc236e91c
|
@ -11,6 +11,7 @@ import middle.capture;
|
|||
import middle.ty;
|
||||
import middle.typeck;
|
||||
import middle.typestate_check;
|
||||
import lib.llvm;
|
||||
import util.common;
|
||||
|
||||
import std.map.mk_hashmap;
|
||||
|
@ -112,9 +113,13 @@ fn compile_input(session.session sess,
|
|||
bind typestate_check.check_crate(crate));
|
||||
}
|
||||
|
||||
time[()](time_passes, "translation",
|
||||
bind trans.trans_crate(sess, crate, ty_cx, type_cache, output, shared,
|
||||
optimize, verify, save_temps, ot));
|
||||
auto llmod = time[llvm.ModuleRef](time_passes, "translation",
|
||||
bind trans.trans_crate(sess, crate, ty_cx, type_cache, output,
|
||||
shared));
|
||||
|
||||
time[()](time_passes, "LLVM passes",
|
||||
bind trans.run_passes(llmod, optimize, verify, save_temps, output,
|
||||
ot));
|
||||
}
|
||||
|
||||
fn pretty_print_input(session.session sess,
|
||||
|
|
|
@ -7748,8 +7748,8 @@ fn create_crate_map(@crate_ctxt ccx) -> ValueRef {
|
|||
}
|
||||
|
||||
fn trans_crate(session.session sess, @ast.crate crate, ty.ctxt tcx,
|
||||
ty.type_cache type_cache, str output, bool shared,
|
||||
bool optimize, bool verify, bool save_temps, output_type ot) {
|
||||
ty.type_cache type_cache, str output, bool shared)
|
||||
-> ModuleRef {
|
||||
auto llmod =
|
||||
llvm.LLVMModuleCreateWithNameInContext(_str.buf("rust_out"),
|
||||
llvm.LLVMGetGlobalContext());
|
||||
|
@ -7816,7 +7816,7 @@ fn trans_crate(session.session sess, @ast.crate crate, ty.ctxt tcx,
|
|||
// Translate the metadata.
|
||||
middle.metadata.write_metadata(cx.ccx, shared, crate);
|
||||
|
||||
run_passes(llmod, optimize, verify, save_temps, output, ot);
|
||||
ret llmod;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue