@@ -35,6 +35,7 @@ pub mod codegen;
3535pub mod lexer;
3636pub mod targets;
3737pub mod ir;
38+ pub mod time;
3839pub mod shlex;
3940
4041use core:: ffi:: * ;
@@ -50,6 +51,7 @@ use arena::Arena;
5051use targets:: * ;
5152use lexer:: { Lexer , Loc , Token } ;
5253use ir:: * ;
54+ use time:: Instant ;
5355use codegen:: * ;
5456use shlex:: * ;
5557
@@ -1302,7 +1304,9 @@ pub unsafe fn main(mut argc: i32, mut argv: *mut*mut c_char) -> Option<()> {
13021304 sb_appendf ( & mut sb, c ! ( "%s" ) , input_path) ;
13031305 }
13041306 da_append ( & mut sb, 0 ) ;
1305- log ( Log_Level :: INFO , c ! ( "compiling files %s" ) , sb. items ) ;
1307+ log ( Log_Level :: INFO , c ! ( "compiling %zu files: %s" ) , input_paths. count , sb. items ) ;
1308+
1309+ let compilation_start = Instant :: now ( ) ;
13061310
13071311 let mut input: String_Builder = zeroed ( ) ;
13081312
@@ -1324,15 +1328,17 @@ pub unsafe fn main(mut argc: i32, mut argv: *mut*mut c_char) -> Option<()> {
13241328
13251329 if find_var_deep ( & mut c. vars , used_global. name ) . is_null ( ) {
13261330 diagf ! ( used_global. loc, c!( "ERROR: could not find name `%s`\n " ) , used_global. name) ;
1327- bump_error_count ( & mut c) ;
1331+ bump_error_count ( & mut c) ? ;
13281332 }
13291333 }
13301334
13311335 scope_pop ( & mut c. vars ) ; // end global scope
13321336
13331337 if c. error_count > 0 {
1334- return None
1338+ return None ;
13351339 }
1340+
1341+ log ( Log_Level :: INFO , c ! ( "compilation took %.3fs" ) , compilation_start. elapsed ( ) . as_secs_f64 ( ) ) ;
13361342 }
13371343
13381344 let mut output: String_Builder = zeroed ( ) ;
0 commit comments