mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
Cleanup assembly source.
This commit is contained in:
parent
39fc0883fd
commit
9e4fddeade
@ -343,16 +343,21 @@ pub fn phase_5_run_llvm_passes(sess: Session,
|
|||||||
(sess.opts.output_type == link::output_type_object ||
|
(sess.opts.output_type == link::output_type_object ||
|
||||||
sess.opts.output_type == link::output_type_exe) {
|
sess.opts.output_type == link::output_type_exe) {
|
||||||
let output_type = link::output_type_assembly;
|
let output_type = link::output_type_assembly;
|
||||||
let obj_filename = outputs.obj_filename.with_filetype("s");
|
let asm_filename = outputs.obj_filename.with_filetype("s");
|
||||||
|
|
||||||
time(sess.time_passes(), ~"LLVM passes", ||
|
time(sess.time_passes(), ~"LLVM passes", ||
|
||||||
link::write::run_passes(sess,
|
link::write::run_passes(sess,
|
||||||
trans.context,
|
trans.context,
|
||||||
trans.module,
|
trans.module,
|
||||||
output_type,
|
output_type,
|
||||||
&obj_filename));
|
&asm_filename));
|
||||||
|
|
||||||
link::write::run_assembler(sess, &obj_filename, &outputs.obj_filename);
|
link::write::run_assembler(sess, &asm_filename, &outputs.obj_filename);
|
||||||
|
|
||||||
|
// Remove assembly source unless --save-temps was specified
|
||||||
|
if !sess.opts.save_temps {
|
||||||
|
os::remove_file(&asm_filename);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
time(sess.time_passes(), ~"LLVM passes", ||
|
time(sess.time_passes(), ~"LLVM passes", ||
|
||||||
link::write::run_passes(sess,
|
link::write::run_passes(sess,
|
||||||
|
Loading…
Reference in New Issue
Block a user