Cleanup assembly source.

This commit is contained in:
Vadim Chugunov 2013-08-19 15:21:30 -07:00
parent 39fc0883fd
commit 9e4fddeade

View File

@ -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_exe) {
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", ||
link::write::run_passes(sess,
trans.context,
trans.module,
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 {
time(sess.time_passes(), ~"LLVM passes", ||
link::write::run_passes(sess,