From 2ebf8bfda476966209d681470ebe6301fb10db0a Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 24 Mar 2015 16:07:45 +0100 Subject: Added missing functions for printing the structs and unions. Still missing printing of packed structs. --- cparser/Parse.ml | 13 +++++++++---- cparser/Parse.mli | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'cparser') diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 59b04e7a..71c9454f 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -41,7 +41,7 @@ let parse_transformations s = let preprocessed_file transfs name sourcefile = Cerrors.reset(); let ic = open_in sourcefile in - let p = + let p,d = try let t = parse_transformations transfs in let lb = Lexer.init name ic in @@ -57,9 +57,14 @@ let preprocessed_file transfs name sourcefile = | Parser.Parser.Inter.Timeout_pr -> assert false | Parser.Parser.Inter.Parsed_pr (ast, _ ) -> ast) in let p1 = Timing.time "Elaboration" Elab.elab_file ast in - Timing.time2 "Emulations" transform_program t p1 + let debug = + if !Clflags.option_g && Configuration.advanced_debug then + Some (CtoDwarf.program_to_dwarf p1 name) + else + None in + Timing.time2 "Emulations" transform_program t p1,debug with | Cerrors.Abort -> - [] in + [],None in close_in ic; - if Cerrors.check_errors() then None else Some p + if Cerrors.check_errors() then None,None else Some p,d diff --git a/cparser/Parse.mli b/cparser/Parse.mli index 58c3cfb9..ac8feb70 100644 --- a/cparser/Parse.mli +++ b/cparser/Parse.mli @@ -15,7 +15,7 @@ (* Entry point for the library: parse, elaborate, and transform *) -val preprocessed_file: string -> string -> string -> C.program option +val preprocessed_file: string -> string -> string -> C.program option * DwarfTypes.dw_entry option (* first arg: desired transformations second arg: source file name before preprocessing -- cgit