diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-28 09:47:40 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-28 09:47:40 +0000 |
commit | de0ae111b043a473d78b510364d9447cf54fed27 (patch) | |
tree | e33da3522aeaa0f165efbd2db7aa6b02b440c747 /cparser | |
parent | e248bbeb6ae319e79715126d18569c2bd856cc75 (diff) | |
download | compcert-de0ae111b043a473d78b510364d9447cf54fed27.tar.gz compcert-de0ae111b043a473d78b510364d9447cf54fed27.zip |
Check in C2C that packed structs were properly emulated.
PackedStructs.ml: remove "packed" attribute once processed.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2388 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser')
-rw-r--r-- | cparser/PackedStructs.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cparser/PackedStructs.ml b/cparser/PackedStructs.ml index 6d184a63..41c00ba8 100644 --- a/cparser/PackedStructs.ml +++ b/cparser/PackedStructs.ml @@ -119,7 +119,8 @@ let transf_composite loc env su id attrs ml = (0L, 0L, false) in let mfa = packed_param_value loc mfa in let msa = packed_param_value loc msa in - transf_struct_decl mfa msa swapped loc env id attrs ml + let attrs' = remove_custom_attributes ["packed";"__packed__"] attrs in + transf_struct_decl mfa msa swapped loc env id attrs' ml (* Accessor functions *) @@ -391,9 +392,13 @@ let rec transf_globdecls env accu = function ({g with gdesc = Gfundef(transf_fundef env f)} :: accu) gl | Gcompositedecl(su, id, attr) -> + let attr' = + match su with + | Union -> attr + | Struct -> remove_custom_attributes ["packed";"__packed__"] attr in transf_globdecls - (Env.add_composite env id (composite_info_decl env su attr)) - (g :: accu) + (Env.add_composite env id (composite_info_decl env su attr')) + ({g with gdesc = Gcompositedecl(su, id, attr')} :: accu) gl | Gcompositedef(su, id, attr, fl) -> let (attr', fl') = transf_composite g.gloc env su id attr fl in |