Skip to content

Commit fa717b4

Browse files
committed
---
yaml --- r: 6637 b: refs/heads/master c: 6156295 h: refs/heads/master i: 6635: 41b5c21 v: v3
1 parent 14f7d60 commit fa717b4

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fd81fb6a2418d3cbef5244662573e2b61d5f66a7
2+
refs/heads/master: 6156295a4c0ed42f1f383aff3aa6cc65fe1e1f30

trunk/src/comp/driver/rustc.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ fn inject_libcore_reference(sess: session::session,
131131

132132

133133
fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str,
134-
output: str) {
134+
output: option::t<str>) {
135+
135136
let time_passes = sess.get_opts().time_passes;
136137
let crate =
137138
time(time_passes, "parsing", bind parse_input(sess, cfg, input));
138139
if sess.get_opts().parse_only { ret; }
140+
139141
crate =
140142
time(time_passes, "configuration",
141143
bind front::config::strip_unconfigured_items(crate));
@@ -186,12 +188,26 @@ fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str,
186188
time(time_passes, "kind checking",
187189
bind kind::check_crate(ty_cx, last_uses, crate));
188190
if sess.get_opts().no_trans { ret; }
191+
192+
let outputs = build_output_filenames(input, output, sess);
193+
189194
let llmod =
190195
time(time_passes, "translation",
191-
bind trans::trans_crate(sess, crate, ty_cx, output, ast_map,
196+
bind trans::trans_crate(sess, crate, ty_cx,
197+
outputs.obj_filename, ast_map,
192198
mut_map, copy_map, last_uses));
193199
time(time_passes, "LLVM passes",
194-
bind link::write::run_passes(sess, llmod, output));
200+
bind link::write::run_passes(sess, llmod, outputs.obj_filename));
201+
202+
let stop_after_codegen =
203+
sess.get_opts().output_type != link::output_type_exe ||
204+
sess.get_opts().static && sess.building_library();
205+
206+
if stop_after_codegen { ret; }
207+
208+
time(time_passes, "Linking",
209+
bind link::link_binary(sess, outputs.obj_filename,
210+
outputs.out_filename));
195211
}
196212

197213
fn pretty_print_input(sess: session::session, cfg: ast::crate_cfg, input: str,
@@ -604,19 +620,7 @@ fn main(args: [str]) {
604620
ret;
605621
}
606622

607-
let outputs = build_output_filenames(ifile, ofile, sess);
608-
609-
let stop_after_codegen =
610-
sopts.output_type != link::output_type_exe ||
611-
sopts.static && sess.building_library();
612-
613-
let temp_filename = outputs.obj_filename;
614-
615-
compile_input(sess, cfg, ifile, temp_filename);
616-
617-
if stop_after_codegen { ret; }
618-
619-
link::link_binary(sess, temp_filename, outputs.out_filename);
623+
compile_input(sess, cfg, ifile, ofile);
620624
}
621625

622626
#[cfg(test)]

0 commit comments

Comments
 (0)