diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-03-26 15:28:16 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-03-26 15:28:16 +0100 |
commit | 56c5da69f66d097dde1ca50ec777df9953eb1952 (patch) | |
tree | 2866b88eb8f99828c8ec275d3d35563379c2bac2 /cparser/Parse.ml | |
parent | 4c81d739be2a2e409c7e76bac3e616c4415a1efd (diff) | |
download | compcert-kvx-56c5da69f66d097dde1ca50ec777df9953eb1952.tar.gz compcert-kvx-56c5da69f66d097dde1ca50ec777df9953eb1952.zip |
Compute the size of structs using the result of the packing and bitfield transformations.
Diffstat (limited to 'cparser/Parse.ml')
-rw-r--r-- | cparser/Parse.ml | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml index 71c9454f..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 @@ -57,12 +62,7 @@ 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 - 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 + Timing.time2 "Emulations" transform_program t p1 name with | Cerrors.Abort -> [],None in |