diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 16:18:46 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-04-14 16:18:46 +0200 |
commit | e42febd5a88c2bf04227f1cd4ead947c51989ec1 (patch) | |
tree | 0661131709c95dc77a5c0583f66caf219a84e8cf /cparser/Parse.ml | |
parent | 03ad26aa9d2762655b508f7142d0aed9916da83b (diff) | |
parent | b597ce896a8a9cd7c3ed028a34e0612229d1a36a (diff) | |
download | compcert-e42febd5a88c2bf04227f1cd4ead947c51989ec1.tar.gz compcert-e42febd5a88c2bf04227f1cd4ead947c51989ec1.zip |
Merge branch 'dwarf' of /local/schommer/trunk/build/compcert.ppc/compcert into dwarf
Diffstat (limited to 'cparser/Parse.ml')
-rw-r--r-- | cparser/Parse.ml | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 59b04e7a..645465c3 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -17,14 +17,19 @@ module CharSet = Set.Make(struct type t = char let compare = compare end) -let transform_program t p = +let transform_program t p name = let run_pass pass flag p = if CharSet.mem flag t then pass p else p in - Rename.program - (run_pass StructReturn.program 's' + let p1 = (run_pass StructReturn.program 's' (run_pass PackedStructs.program 'p' (run_pass Bitfields.program 'f' (run_pass Unblock.program 'b' - p)))) + p)))) in + let debug = + if !Clflags.option_g && Configuration.advanced_debug then + Some (CtoDwarf.program_to_dwarf p p1 name) + else + None in + (Rename.program p1),debug let parse_transformations s = let t = ref CharSet.empty in @@ -41,7 +46,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 +62,9 @@ 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 + Timing.time2 "Emulations" transform_program t p1 name 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 |