@@ -15,7 +15,8 @@ pub use self::PpSourceMode::*;
15
15
pub use self :: PpMode :: * ;
16
16
use self :: NodesMatchingUII :: * ;
17
17
18
- use { driver, abort_on_err} ;
18
+ use abort_on_err;
19
+ use driver:: { self , Resolutions } ;
19
20
20
21
use rustc:: dep_graph:: DepGraph ;
21
22
use rustc:: ty:: { self , TyCtxt } ;
@@ -25,7 +26,6 @@ use rustc::session::Session;
25
26
use rustc:: session:: config:: Input ;
26
27
use rustc_borrowck as borrowck;
27
28
use rustc_borrowck:: graphviz as borrowck_dot;
28
- use rustc_resolve as resolve;
29
29
30
30
use rustc_mir:: pretty:: write_mir_pretty;
31
31
use rustc_mir:: graphviz:: write_mir_graphviz;
@@ -202,6 +202,8 @@ impl PpSourceMode {
202
202
fn call_with_pp_support_hir < ' tcx , A , B , F > ( & self ,
203
203
sess : & ' tcx Session ,
204
204
ast_map : & hir_map:: Map < ' tcx > ,
205
+ analysis : & ty:: CrateAnalysis ,
206
+ resolutions : & Resolutions ,
205
207
arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
206
208
id : & str ,
207
209
payload : B ,
@@ -226,12 +228,12 @@ impl PpSourceMode {
226
228
f ( & annotation, payload, ast_map. forest . krate ( ) )
227
229
}
228
230
PpmTyped => {
229
- /*
230
231
abort_on_err ( driver:: phase_3_run_analysis_passes ( sess,
231
232
ast_map. clone ( ) ,
233
+ analysis. clone ( ) ,
234
+ resolutions. clone ( ) ,
232
235
arenas,
233
236
id,
234
- resolve::MakeGlobMap::No,
235
237
|tcx, _, _, _| {
236
238
let annotation = TypedAnnotation {
237
239
tcx : tcx,
@@ -241,8 +243,6 @@ impl PpSourceMode {
241
243
payload,
242
244
ast_map. forest . krate ( ) )
243
245
} ) , sess)
244
- */
245
- unimplemented ! ( )
246
246
}
247
247
_ => panic ! ( "Should use call_with_pp_support" ) ,
248
248
}
@@ -814,6 +814,8 @@ pub fn print_after_parsing(sess: &Session,
814
814
815
815
pub fn print_after_write_deps < ' tcx , ' a : ' tcx > ( sess : & ' a Session ,
816
816
ast_map : & hir_map:: Map < ' tcx > ,
817
+ analysis : & ty:: CrateAnalysis ,
818
+ resolutions : & Resolutions ,
817
819
input : & Input ,
818
820
krate : & ast:: Crate ,
819
821
crate_name : & str ,
@@ -825,7 +827,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
825
827
let _ignore = dep_graph. in_ignore ( ) ;
826
828
827
829
if ppm. needs_analysis ( ) {
828
- print_with_analysis ( sess, ast_map, crate_name, arenas, ppm, opt_uii, ofile) ;
830
+ print_with_analysis ( sess, ast_map, analysis, resolutions,
831
+ crate_name, arenas, ppm, opt_uii, ofile) ;
829
832
return ;
830
833
}
831
834
@@ -856,6 +859,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
856
859
let out: & mut Write = & mut out;
857
860
s. call_with_pp_support_hir ( sess,
858
861
ast_map,
862
+ analysis,
863
+ resolutions,
859
864
arenas,
860
865
crate_name,
861
866
box out,
@@ -877,6 +882,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
877
882
let out: & mut Write = & mut out;
878
883
s. call_with_pp_support_hir ( sess,
879
884
ast_map,
885
+ analysis,
886
+ resolutions,
880
887
arenas,
881
888
crate_name,
882
889
( out, uii) ,
@@ -917,6 +924,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
917
924
// Instead, we call that function ourselves.
918
925
fn print_with_analysis < ' tcx , ' a : ' tcx > ( sess : & ' a Session ,
919
926
ast_map : & hir_map:: Map < ' tcx > ,
927
+ analysis : & ty:: CrateAnalysis ,
928
+ resolutions : & Resolutions ,
920
929
crate_name : & str ,
921
930
arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
922
931
ppm : PpMode ,
@@ -930,14 +939,14 @@ fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
930
939
None
931
940
} ;
932
941
933
- /*
934
942
let mut out = Vec :: new ( ) ;
935
943
936
944
abort_on_err ( driver:: phase_3_run_analysis_passes ( sess,
937
945
ast_map. clone ( ) ,
946
+ analysis. clone ( ) ,
947
+ resolutions. clone ( ) ,
938
948
arenas,
939
949
crate_name,
940
- resolve::MakeGlobMap::No,
941
950
|tcx, mir_map, _, _| {
942
951
match ppm {
943
952
PpmMir | PpmMirCFG => {
@@ -1002,6 +1011,4 @@ fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
1002
1011
} ) , sess) . unwrap ( ) ;
1003
1012
1004
1013
write_output ( out, ofile) ;
1005
- */
1006
- unimplemented ! ( )
1007
1014
}
0 commit comments