From fe8baff11737d3785ff51d20ace9ab31665cd295 Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 12 May 2011 09:41:09 +0000 Subject: cparser: support for attributes over struct and union. cparser: added experimental emulation of packed structs (PackedStruct.ml) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1650 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- driver/Clflags.ml | 1 + driver/Driver.ml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'driver') diff --git a/driver/Clflags.ml b/driver/Clflags.ml index c47d0f3..2a96c38 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -20,6 +20,7 @@ let option_fstruct_passing = ref false let option_fstruct_assign = ref false let option_fbitfields = ref false let option_fvararg_calls = ref true +let option_fpacked_structs = ref false let option_fmadd = ref false let option_dparse = ref false let option_dcmedium = ref false diff --git a/driver/Driver.ml b/driver/Driver.ml index 87b1569..6aa63e0 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -71,7 +71,9 @@ let compile_c_file sourcename ifile ofile = "b" (* blocks: mandatory *) ^ (if !option_fstruct_passing then "s" else "") ^ (if !option_fstruct_assign then "S" else "") - ^ (if !option_fbitfields then "f" else "") in + ^ (if !option_fbitfields then "f" else "") + ^ (if !option_fpacked_structs then "p" else "") + in (* Parsing and production of a simplified C AST *) let ast = match Cparser.Parse.preprocessed_file simplifs sourcename ifile with @@ -258,6 +260,7 @@ Language support options (use -fno- to turn off -f) : -fstruct-passing Emulate passing structs and unions by value [off] -fstruct-assign Emulate assignment between structs or unions [off] -fvararg-calls Emulate calls to variable-argument functions [on] + -fpacked-structs Emulate packed structs [off] Code generation options: -fmadd Use fused multiply-add and multiply-sub instructions [off] -fsmall-data Set maximal size for allocation in small data area @@ -387,6 +390,7 @@ let cmdline_actions = @ f_opt "bitfields" option_fbitfields @ f_opt "vararg-calls" option_fvararg_calls @ f_opt "madd" option_fmadd + @ f_opt "packed-structs" option_fpacked_structs let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 524288 }; -- cgit v1.2.3