Skip to content

Commit 43bfd4c

Browse files
committed
Fix some nits
1 parent e130ccc commit 43bfd4c

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

src/librustc_driver/driver.rs

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,11 @@ pub fn compile_input(sess: &Session,
275275
phase5_result);
276276
phase5_result?;
277277

278-
phase_6_link_output::<DefaultTransCrate>(sess, &trans, &outputs);
278+
// Run the linker on any artifacts that resulted from the LLVM run.
279+
// This should produce either a finished executable or library.
280+
time(sess.time_passes(), "linking", || {
281+
DefaultTransCrate::link_binary(sess, &trans, &outputs)
282+
});
279283

280284
// Now that we won't touch anything in the incremental compilation directory
281285
// any more, we can finalize it (which involves renaming it)
@@ -1112,9 +1116,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
11121116

11131117
/// Run the translation phase to LLVM, after which the AST and analysis can
11141118
/// be discarded.
1115-
pub fn phase_4_translate_to_llvm<'a, 'tcx, T: TransCrate>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1119+
pub fn phase_4_translate_to_llvm<'a, 'tcx, Trans: TransCrate>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11161120
rx: mpsc::Receiver<Box<Any + Send>>)
1117-
-> <T as TransCrate>::OngoingCrateTranslation {
1121+
-> <Trans as TransCrate>::OngoingCrateTranslation {
11181122
let time_passes = tcx.sess.time_passes();
11191123

11201124
time(time_passes,
@@ -1123,7 +1127,7 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx, T: TransCrate>(tcx: TyCtxt<'a, 'tcx,
11231127

11241128
let translation =
11251129
time(time_passes, "translation", move || {
1126-
T::trans_crate(tcx, rx)
1130+
Trans::trans_crate(tcx, rx)
11271131
});
11281132
if tcx.sess.profile_queries() {
11291133
profile::dump("profile_queries".to_string())
@@ -1134,14 +1138,14 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx, T: TransCrate>(tcx: TyCtxt<'a, 'tcx,
11341138

11351139
/// Run LLVM itself, producing a bitcode file, assembly file or object file
11361140
/// as a side effect.
1137-
pub fn phase_5_run_llvm_passes<T: TransCrate>(sess: &Session,
1141+
pub fn phase_5_run_llvm_passes<Trans: TransCrate>(sess: &Session,
11381142
dep_graph: &DepGraph,
1139-
trans: <T as TransCrate>::OngoingCrateTranslation)
1140-
-> (CompileResult, <T as TransCrate>::TranslatedCrate) {
1141-
let trans = T::join_trans(trans, sess, dep_graph);
1143+
trans: <Trans as TransCrate>::OngoingCrateTranslation)
1144+
-> (CompileResult, <Trans as TransCrate>::TranslatedCrate) {
1145+
let trans = Trans::join_trans(trans, sess, dep_graph);
11421146

11431147
if sess.opts.debugging_opts.incremental_info {
1144-
T::dump_incremental_data(&trans);
1148+
Trans::dump_incremental_data(&trans);
11451149
}
11461150

11471151
time(sess.time_passes(),
@@ -1151,16 +1155,6 @@ pub fn phase_5_run_llvm_passes<T: TransCrate>(sess: &Session,
11511155
(sess.compile_status(), trans)
11521156
}
11531157

1154-
/// Run the linker on any artifacts that resulted from the LLVM run.
1155-
/// This should produce either a finished executable or library.
1156-
pub fn phase_6_link_output<T: TransCrate>(sess: &Session,
1157-
trans: &<T as TransCrate>::TranslatedCrate,
1158-
outputs: &OutputFilenames) {
1159-
time(sess.time_passes(), "linking", || {
1160-
T::link_binary(sess, trans, outputs)
1161-
});
1162-
}
1163-
11641158
fn escape_dep_filename(filename: &str) -> String {
11651159
// Apparently clang and gcc *only* escape spaces:
11661160
// http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4

src/librustc_trans_utils/trans_crate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ impl MetadataLoaderTrait for NoLlvmMetadataLoader {
153153
}
154154
}
155155

156-
#[allow(dead_code)]
157156
pub struct MetadataOnlyTransCrate;
158157
pub struct OngoingCrateTranslation {
159158
metadata: EncodedMetadata,

0 commit comments

Comments
 (0)