aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Parse.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Parse.ml')
-rw-r--r--cparser/Parse.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml
index c9564c08..47698f8d 100644
--- a/cparser/Parse.ml
+++ b/cparser/Parse.ml
@@ -49,12 +49,16 @@ let preprocessed_file transfs name sourcefile =
let p,d =
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. *)