@@ -4,7 +4,7 @@ import session::session;
44import syntax:: parse;
55import syntax :: { ast, codemap} ;
66import syntax:: attr;
7- import middle :: { trans, resolve, freevars, kind, ty, typeck, fn_usage ,
7+ import middle :: { trans, resolve, freevars, kind, ty, typeck,
88 last_use, lint} ;
99import syntax:: print:: { pp, pprust} ;
1010import util :: { ppaux, filesearch} ;
@@ -158,12 +158,13 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
158158 bind middle:: block_use:: check_crate ( ty_cx, crate ) ) ;
159159 time ( time_passes, "loop checking" ,
160160 bind middle:: check_loop:: check_crate ( ty_cx, crate ) ) ;
161- time ( time_passes, "function usage" ,
162- bind fn_usage:: check_crate_fn_usage ( ty_cx, crate ) ) ;
163161 time ( time_passes, "alt checking" ,
164162 bind middle:: check_alt:: check_crate ( ty_cx, crate ) ) ;
165163 time ( time_passes, "typestate checking" ,
166164 bind middle:: tstate:: ck:: check_crate ( ty_cx, crate ) ) ;
165+ let _root_map = time (
166+ time_passes, "borrow checking" ,
167+ bind middle:: borrowck:: check_crate ( ty_cx, method_map, crate ) ) ;
167168 let mutbl_map =
168169 time ( time_passes, "mutability checking" ,
169170 bind middle:: mutbl:: check_crate ( ty_cx, crate ) ) ;
@@ -401,6 +402,14 @@ fn build_session_options(match: getopts::match,
401402 let target_opt = getopts:: opt_maybe_str( match , "target" ) ;
402403 let mut no_asm_comments = getopts:: opt_present( match , "no-asm-comments" ) ;
403404 let debug_rustc = getopts:: opt_present( match , "debug-rustc" ) ;
405+ let borrowck = alt getopts:: opt_maybe_str( match , "borrowck" ) {
406+ none { 0 u }
407+ some( "warn" ) { 1 u }
408+ some( "err" ) { 2 u }
409+ some( _) {
410+ early_error( demitter, "borrowck may be warn or err" )
411+ }
412+ } ;
404413 alt output_type {
405414 // unless we're emitting huamn-readable assembly, omit comments.
406415 link:: output_type_llvm_assembly | link:: output_type_assembly { }
@@ -455,7 +464,8 @@ fn build_session_options(match: getopts::match,
455464 parse_only : parse_only ,
456465 no_trans : no_trans ,
457466 no_asm_comments : no_asm_comments ,
458- debug_rustc : debug_rustc } ;
467+ debug_rustc : debug_rustc ,
468+ borrowck : borrowck } ;
459469 ret sopts;
460470}
461471
@@ -533,7 +543,8 @@ fn opts() -> [getopts::opt] {
533543 optmulti ( "cfg" ) , optflag ( "test" ) ,
534544 optflag ( "lib" ) , optflag ( "bin" ) , optflag ( "static" ) , optflag ( "gc" ) ,
535545 optflag ( "no-asm-comments" ) ,
536- optflag ( "debug-rustc" ) ] ;
546+ optflag ( "debug-rustc" ) ,
547+ optopt ( "borrowck" ) ] ;
537548}
538549
539550type output_filenames = @{ out_filename : str , obj_filename : str } ;
0 commit comments