@@ -6,7 +6,7 @@ import syntax::parse::{parser};
6
6
import syntax :: { ast, codemap} ;
7
7
import front:: attr;
8
8
import middle :: { trans, resolve, freevars, kind, ty, typeck, fn_usage,
9
- last_use, check_usage } ;
9
+ last_use, lint } ;
10
10
import syntax:: print:: { pp, pprust} ;
11
11
import util :: { ppaux, filesearch} ;
12
12
import back:: link;
@@ -203,9 +203,9 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
203
203
bind last_use:: find_last_uses ( crate , def_map, ref_map, ty_cx) ) ;
204
204
time ( time_passes, "kind checking" ,
205
205
bind kind:: check_crate ( ty_cx, method_map, last_uses, crate ) ) ;
206
- if sess. opts . check_usage {
207
- time ( time_passes, "usage analyses" ,
208
- bind check_usage :: check_crate ( ty_cx, crate ) ) ;
206
+ if vec :: len ( sess. opts . lint_opts ) > 0 u {
207
+ let timer = bind time ( time_passes, _ , _ ) ;
208
+ lint :: check_crate ( ty_cx, crate , sess . opts . lint_opts , timer )
209
209
}
210
210
211
211
if upto == cu_no_trans { ret { crate: crate , tcx : some ( ty_cx) , src : src} ; }
@@ -384,6 +384,10 @@ fn build_session_options(match: getopts::match,
384
384
385
385
let parse_only = opt_present ( match , "parse-only" ) ;
386
386
let no_trans = opt_present ( match , "no-trans" ) ;
387
+ let lint_opts : [ lint:: option ] = [ ] ;
388
+ if !opt_present ( match , "no-lint-ctypes" ) {
389
+ lint_opts += [ lint:: ctypes] ;
390
+ }
387
391
388
392
let output_type =
389
393
if parse_only || no_trans {
@@ -399,7 +403,6 @@ fn build_session_options(match: getopts::match,
399
403
} else { link : : output_type_exe } ;
400
404
let libcore = !opt_present( match , "no-core" ) ;
401
405
let verify = !opt_present( match , "no-verify" ) ;
402
- let check_usage = !opt_present( match , "no-usage-check" ) ;
403
406
let save_temps = opt_present( match , "save-temps" ) ;
404
407
let extra_debuginfo = opt_present( match , "xg" ) ;
405
408
let debuginfo = opt_present( match , "g" ) || extra_debuginfo;
@@ -451,7 +454,7 @@ fn build_session_options(match: getopts::match,
451
454
debuginfo : debuginfo ,
452
455
extra_debuginfo : extra_debuginfo ,
453
456
verify : verify ,
454
- check_usage : check_usage ,
457
+ lint_opts : lint_opts ,
455
458
save_temps : save_temps ,
456
459
stats : stats ,
457
460
time_passes : time_passes ,
@@ -520,7 +523,7 @@ fn opts() -> [getopts::opt] {
520
523
optopt ( "sysroot" ) , optopt ( "target" ) , optflag ( "stats" ) ,
521
524
optflag ( "time-passes" ) , optflag ( "time-llvm-passes" ) ,
522
525
optflag ( "no-verify" ) ,
523
- optflag ( "no-usage-check " ) ,
526
+ optflag ( "no-lint-ctypes " ) ,
524
527
optmulti ( "cfg" ) , optflag ( "test" ) ,
525
528
optflag ( "no-core" ) ,
526
529
optflag ( "lib" ) , optflag ( "bin" ) , optflag ( "static" ) , optflag ( "gc" ) ,
0 commit comments