@@ -37,7 +37,7 @@ pub struct CrateAnalysis {
3737
3838/// Parses, resolves, and typechecks the given crate
3939fn get_ast_and_resolve ( cpath : & Path ,
40- libs : HashSet < Path > ) -> ( DocContext , CrateAnalysis ) {
40+ libs : HashSet < Path > , cfgs : ~ [ ~ str ] ) -> ( DocContext , CrateAnalysis ) {
4141 use syntax:: codemap:: dummy_spanned;
4242 use rustc:: driver:: driver:: { file_input, build_configuration,
4343 phase_1_parse_input,
@@ -66,7 +66,9 @@ fn get_ast_and_resolve(cpath: &Path,
6666 span_diagnostic_handler) ;
6767
6868 let mut cfg = build_configuration ( sess) ;
69- cfg. push ( @dummy_spanned ( ast:: MetaWord ( @"stage2") ) ) ;
69+ for cfg_ in cfgs. move_iter ( ) {
70+ cfg. push ( @dummy_spanned ( ast:: MetaWord ( cfg_. to_managed ( ) ) ) ) ;
71+ }
7072
7173 let mut crate = phase_1_parse_input ( sess, cfg. clone ( ) , & input) ;
7274 crate = phase_2_configure_and_expand ( sess, cfg, crate ) ;
@@ -79,8 +81,8 @@ fn get_ast_and_resolve(cpath: &Path,
7981 CrateAnalysis { exported_items : exported_items } ) ;
8082}
8183
82- pub fn run_core ( libs : HashSet < Path > , path : & Path ) -> ( clean:: Crate , CrateAnalysis ) {
83- let ( ctxt, analysis) = get_ast_and_resolve ( path, libs) ;
84+ pub fn run_core ( libs : HashSet < Path > , cfgs : ~ [ ~ str ] , path : & Path ) -> ( clean:: Crate , CrateAnalysis ) {
85+ let ( ctxt, analysis) = get_ast_and_resolve ( path, libs, cfgs ) ;
8486 let ctxt = @ctxt;
8587 debug ! ( "defmap:" ) ;
8688 for ( k, v) in ctxt. tycx . def_map . iter ( ) {
0 commit comments