diff options
Diffstat (limited to 'cparser/Parse.ml')
-rw-r--r-- | cparser/Parse.ml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 2be3a612..cfa95688 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -44,12 +44,16 @@ let preprocessed_file transfs name sourcefile = let p = try let t = parse_transformations transfs in - let lb = Lexer.init name ic in let rec inf = Datatypes.S inf in let ast : Cabs.definition list = Obj.magic - (match Timing.time2 "Parsing" - Parser.translation_unit_file inf (Lexer.tokens_stream lb) with + (match Timing.time "Parsing" + (* The call to Lexer.tokens_stream results in the pre + parsing of the entire file. This is non-negligeabe, + so we cannot use Timing.time2 *) + (fun () -> + Parser.translation_unit_file inf (Lexer.tokens_stream name ic)) () + with | Parser.Parser.Inter.Fail_pr -> (* Theoretically impossible : implies inconsistencies between grammars. *) |