@@ -37,7 +37,7 @@ pub struct CrateAnalysis {
37
37
38
38
/// Parses, resolves, and typechecks the given crate
39
39
fn get_ast_and_resolve ( cpath : & Path ,
40
- libs : HashSet < Path > ) -> ( DocContext , CrateAnalysis ) {
40
+ libs : HashSet < Path > , cfgs : ~ [ ~ str ] ) -> ( DocContext , CrateAnalysis ) {
41
41
use syntax:: codemap:: dummy_spanned;
42
42
use rustc:: driver:: driver:: { file_input, build_configuration,
43
43
phase_1_parse_input,
@@ -66,7 +66,9 @@ fn get_ast_and_resolve(cpath: &Path,
66
66
span_diagnostic_handler) ;
67
67
68
68
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
+ }
70
72
71
73
let mut crate = phase_1_parse_input ( sess, cfg. clone ( ) , & input) ;
72
74
crate = phase_2_configure_and_expand ( sess, cfg, crate ) ;
@@ -79,8 +81,8 @@ fn get_ast_and_resolve(cpath: &Path,
79
81
CrateAnalysis { exported_items : exported_items } ) ;
80
82
}
81
83
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 ) ;
84
86
let ctxt = @ctxt;
85
87
debug ! ( "defmap:" ) ;
86
88
for ( k, v) in ctxt. tycx . def_map . iter ( ) {
0 commit comments