@@ -15,7 +15,8 @@ pub use self::PpSourceMode::*;
1515pub use self :: PpMode :: * ;
1616use self :: NodesMatchingUII :: * ;
1717
18- use { driver, abort_on_err} ;
18+ use abort_on_err;
19+ use driver:: { self , Resolutions } ;
1920
2021use rustc:: dep_graph:: DepGraph ;
2122use rustc:: ty:: { self , TyCtxt } ;
@@ -25,7 +26,6 @@ use rustc::session::Session;
2526use rustc:: session:: config:: Input ;
2627use rustc_borrowck as borrowck;
2728use rustc_borrowck:: graphviz as borrowck_dot;
28- use rustc_resolve as resolve;
2929
3030use rustc_mir:: pretty:: write_mir_pretty;
3131use rustc_mir:: graphviz:: write_mir_graphviz;
@@ -202,6 +202,8 @@ impl PpSourceMode {
202202 fn call_with_pp_support_hir < ' tcx , A , B , F > ( & self ,
203203 sess : & ' tcx Session ,
204204 ast_map : & hir_map:: Map < ' tcx > ,
205+ analysis : & ty:: CrateAnalysis ,
206+ resolutions : & Resolutions ,
205207 arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
206208 id : & str ,
207209 payload : B ,
@@ -226,12 +228,12 @@ impl PpSourceMode {
226228 f ( & annotation, payload, ast_map. forest . krate ( ) )
227229 }
228230 PpmTyped => {
229- /*
230231 abort_on_err ( driver:: phase_3_run_analysis_passes ( sess,
231232 ast_map. clone ( ) ,
233+ analysis. clone ( ) ,
234+ resolutions. clone ( ) ,
232235 arenas,
233236 id,
234- resolve::MakeGlobMap::No,
235237 |tcx, _, _, _| {
236238 let annotation = TypedAnnotation {
237239 tcx : tcx,
@@ -241,8 +243,6 @@ impl PpSourceMode {
241243 payload,
242244 ast_map. forest . krate ( ) )
243245 } ) , sess)
244- */
245- unimplemented ! ( )
246246 }
247247 _ => panic ! ( "Should use call_with_pp_support" ) ,
248248 }
@@ -814,6 +814,8 @@ pub fn print_after_parsing(sess: &Session,
814814
815815pub fn print_after_write_deps < ' tcx , ' a : ' tcx > ( sess : & ' a Session ,
816816 ast_map : & hir_map:: Map < ' tcx > ,
817+ analysis : & ty:: CrateAnalysis ,
818+ resolutions : & Resolutions ,
817819 input : & Input ,
818820 krate : & ast:: Crate ,
819821 crate_name : & str ,
@@ -825,7 +827,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
825827 let _ignore = dep_graph. in_ignore ( ) ;
826828
827829 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) ;
829832 return ;
830833 }
831834
@@ -856,6 +859,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
856859 let out: & mut Write = & mut out;
857860 s. call_with_pp_support_hir ( sess,
858861 ast_map,
862+ analysis,
863+ resolutions,
859864 arenas,
860865 crate_name,
861866 box out,
@@ -877,6 +882,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
877882 let out: & mut Write = & mut out;
878883 s. call_with_pp_support_hir ( sess,
879884 ast_map,
885+ analysis,
886+ resolutions,
880887 arenas,
881888 crate_name,
882889 ( out, uii) ,
@@ -917,6 +924,8 @@ pub fn print_after_write_deps<'tcx, 'a: 'tcx>(sess: &'a Session,
917924// Instead, we call that function ourselves.
918925fn print_with_analysis < ' tcx , ' a : ' tcx > ( sess : & ' a Session ,
919926 ast_map : & hir_map:: Map < ' tcx > ,
927+ analysis : & ty:: CrateAnalysis ,
928+ resolutions : & Resolutions ,
920929 crate_name : & str ,
921930 arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
922931 ppm : PpMode ,
@@ -930,14 +939,14 @@ fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
930939 None
931940 } ;
932941
933- /*
934942 let mut out = Vec :: new ( ) ;
935943
936944 abort_on_err ( driver:: phase_3_run_analysis_passes ( sess,
937945 ast_map. clone ( ) ,
946+ analysis. clone ( ) ,
947+ resolutions. clone ( ) ,
938948 arenas,
939949 crate_name,
940- resolve::MakeGlobMap::No,
941950 |tcx, mir_map, _, _| {
942951 match ppm {
943952 PpmMir | PpmMirCFG => {
@@ -1002,6 +1011,4 @@ fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
10021011 } ) , sess) . unwrap ( ) ;
10031012
10041013 write_output ( out, ofile) ;
1005- */
1006- unimplemented ! ( )
10071014}
0 commit comments