@@ -19,7 +19,7 @@ use rustc_trans::back::link;
1919
2020use driver;
2121
22- use rustc:: middle:: { ty , subst } ;
22+ use rustc:: middle:: ty ;
2323use rustc:: middle:: cfg;
2424use rustc:: middle:: cfg:: graphviz:: LabelledCFG ;
2525use rustc:: session:: Session ;
@@ -40,7 +40,6 @@ use graphviz as dot;
4040use std:: io:: { mod, MemReader } ;
4141use std:: option;
4242use std:: str:: FromStr ;
43- use arena:: TypedArena ;
4443
4544#[ deriving( Copy , PartialEq , Show ) ]
4645pub enum PpSourceMode {
@@ -112,9 +111,7 @@ impl PpSourceMode {
112111 fn call_with_pp_support < ' tcx , A , B , F > ( & self ,
113112 sess : Session ,
114113 ast_map : Option < ast_map:: Map < ' tcx > > ,
115- type_arena : & ' tcx TypedArena < ty:: TyS < ' tcx > > ,
116- substs_arena : & ' tcx TypedArena < subst:: Substs < ' tcx > > ,
117- bare_fn_arena : & ' tcx TypedArena < ty:: BareFnTy < ' tcx > > ,
114+ arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
118115 id : String ,
119116 payload : B ,
120117 f : F ) -> A where
@@ -136,10 +133,7 @@ impl PpSourceMode {
136133 }
137134 PpmTyped => {
138135 let ast_map = ast_map. expect ( "--pretty=typed missing ast_map" ) ;
139- let analysis = driver:: phase_3_run_analysis_passes ( sess, ast_map,
140- type_arena, substs_arena,
141- bare_fn_arena,
142- id) ;
136+ let analysis = driver:: phase_3_run_analysis_passes ( sess, ast_map, arenas, id) ;
143137 let annotation = TypedAnnotation { analysis : analysis } ;
144138 f ( & annotation, payload)
145139 }
@@ -514,9 +508,7 @@ pub fn pretty_print_input(sess: Session,
514508 } ;
515509
516510 let mut forest = ast_map:: Forest :: new ( krate) ;
517- let type_arena = TypedArena :: new ( ) ;
518- let substs_arena = TypedArena :: new ( ) ;
519- let bare_fn_arena = TypedArena :: new ( ) ;
511+ let arenas = ty:: CtxtArenas :: new ( ) ;
520512
521513 let ( krate, ast_map) = if compute_ast_map {
522514 let map = driver:: assign_node_ids_and_map ( & sess, & mut forest) ;
@@ -545,8 +537,7 @@ pub fn pretty_print_input(sess: Session,
545537 match ( ppm, opt_uii) {
546538 ( PpmSource ( s) , None ) =>
547539 s. call_with_pp_support (
548- sess, ast_map, & type_arena, & substs_arena, & bare_fn_arena,
549- id, out, |annotation, out| {
540+ sess, ast_map, & arenas, id, out, |annotation, out| {
550541 debug ! ( "pretty printing source code {}" , s) ;
551542 let sess = annotation. sess ( ) ;
552543 pprust:: print_crate ( sess. codemap ( ) ,
@@ -561,8 +552,7 @@ pub fn pretty_print_input(sess: Session,
561552
562553 ( PpmSource ( s) , Some ( uii) ) =>
563554 s. call_with_pp_support (
564- sess, ast_map, & type_arena, & substs_arena, & bare_fn_arena,
565- id, ( out, uii) , |annotation, ( out, uii) | {
555+ sess, ast_map, & arenas, id, ( out, uii) , |annotation, ( out, uii) | {
566556 debug ! ( "pretty printing source code {}" , s) ;
567557 let sess = annotation. sess ( ) ;
568558 let ast_map = annotation. ast_map ( )
@@ -604,10 +594,7 @@ pub fn pretty_print_input(sess: Session,
604594 match code {
605595 Some ( code) => {
606596 let variants = gather_flowgraph_variants ( & sess) ;
607- let analysis = driver:: phase_3_run_analysis_passes ( sess, ast_map,
608- & type_arena, & substs_arena,
609- & bare_fn_arena,
610- id) ;
597+ let analysis = driver:: phase_3_run_analysis_passes ( sess, ast_map, & arenas, id) ;
611598 print_flowgraph ( variants, analysis, code, out)
612599 }
613600 None => {
0 commit comments