@@ -275,7 +275,11 @@ pub fn compile_input(sess: &Session,
275
275
phase5_result) ;
276
276
phase5_result?;
277
277
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
+ } ) ;
279
283
280
284
// Now that we won't touch anything in the incremental compilation directory
281
285
// 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,
1112
1116
1113
1117
/// Run the translation phase to LLVM, after which the AST and analysis can
1114
1118
/// 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 > ,
1116
1120
rx : mpsc:: Receiver < Box < Any + Send > > )
1117
- -> <T as TransCrate >:: OngoingCrateTranslation {
1121
+ -> <Trans as TransCrate >:: OngoingCrateTranslation {
1118
1122
let time_passes = tcx. sess . time_passes ( ) ;
1119
1123
1120
1124
time ( time_passes,
@@ -1123,7 +1127,7 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx, T: TransCrate>(tcx: TyCtxt<'a, 'tcx,
1123
1127
1124
1128
let translation =
1125
1129
time ( time_passes, "translation" , move || {
1126
- T :: trans_crate ( tcx, rx)
1130
+ Trans :: trans_crate ( tcx, rx)
1127
1131
} ) ;
1128
1132
if tcx. sess . profile_queries ( ) {
1129
1133
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,
1134
1138
1135
1139
/// Run LLVM itself, producing a bitcode file, assembly file or object file
1136
1140
/// 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 ,
1138
1142
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) ;
1142
1146
1143
1147
if sess. opts . debugging_opts . incremental_info {
1144
- T :: dump_incremental_data ( & trans) ;
1148
+ Trans :: dump_incremental_data ( & trans) ;
1145
1149
}
1146
1150
1147
1151
time ( sess. time_passes ( ) ,
@@ -1151,16 +1155,6 @@ pub fn phase_5_run_llvm_passes<T: TransCrate>(sess: &Session,
1151
1155
( sess. compile_status ( ) , trans)
1152
1156
}
1153
1157
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
-
1164
1158
fn escape_dep_filename ( filename : & str ) -> String {
1165
1159
// Apparently clang and gcc *only* escape spaces:
1166
1160
// http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
0 commit comments