diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2016-03-21 10:18:51 +0100 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2016-03-21 10:18:51 +0100 |
commit | 20eef936dce1ef98b5b422c90cc9e072fb0d75ab (patch) | |
tree | 2690be164dc36fad63fc0f42e943d0fcb0735532 /cparser/PackedStructs.ml | |
parent | fdf4cac2439a7168bd005efbde4a1f76a00ada66 (diff) | |
parent | 01e32a075023ce7b037d42d048b1904ba3d9a82b (diff) | |
download | compcert-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.tar.gz compcert-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.zip |
Merge pull request #92 from AbsInt/cleanup
This PR activates more OCaml warnings and turns all warnings into errors. Also some unused functions, variables and types are removed.
Diffstat (limited to 'cparser/PackedStructs.ml')
-rw-r--r-- | cparser/PackedStructs.ml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cparser/PackedStructs.ml b/cparser/PackedStructs.ml index 6ea5d121..aafa1caa 100644 --- a/cparser/PackedStructs.ml +++ b/cparser/PackedStructs.ml @@ -127,7 +127,7 @@ let transf_composite loc env su id attrs ml = (* Accessor functions *) -let lookup_function loc env name = +let lookup_function env name = match Env.lookup_ident env name with | (id, II_ident(sto, ty)) -> (id, ty) | (id, II_enum _) -> raise (Env.Error(Env.Unbound_identifier name)) @@ -161,14 +161,14 @@ let bswap_read loc env lval = try if !use_reversed then begin let (id, fty) = - lookup_function loc env (sprintf "__builtin_read%d_reversed" bsize) in + lookup_function env (sprintf "__builtin_read%d_reversed" bsize) in let fn = {edesc = EVar id; etyp = fty} in let args = [ecast_opt env (TPtr(aty,[])) (eaddrof lval)] in let call = {edesc = ECall(fn, args); etyp = aty} in ecast_opt env ty call end else begin let (id, fty) = - lookup_function loc env (sprintf "__builtin_bswap%d" bsize) in + lookup_function env (sprintf "__builtin_bswap%d" bsize) in let fn = {edesc = EVar id; etyp = fty} in let args = [ecast_opt env aty lval] in let call = {edesc = ECall(fn, args); etyp = aty} in @@ -188,14 +188,14 @@ let bswap_write loc env lhs rhs = try if !use_reversed then begin let (id, fty) = - lookup_function loc env (sprintf "__builtin_write%d_reversed" bsize) in + lookup_function env (sprintf "__builtin_write%d_reversed" bsize) in let fn = {edesc = EVar id; etyp = fty} in let args = [ecast_opt env (TPtr(aty,[])) (eaddrof lhs); ecast_opt env aty rhs] in {edesc = ECall(fn, args); etyp = TVoid[]} end else begin let (id, fty) = - lookup_function loc env (sprintf "__builtin_bswap%d" bsize) in + lookup_function env (sprintf "__builtin_bswap%d" bsize) in let fn = {edesc = EVar id; etyp = fty} in let args = [ecast_opt env aty rhs] in let call = {edesc = ECall(fn, args); etyp = aty} in @@ -403,7 +403,7 @@ let rec transf_globdecls env accu = function | Union -> attr | Struct -> remove_custom_attributes ["packed";"__packed__"] attr in transf_globdecls - (Env.add_composite env id (composite_info_decl env su attr')) + (Env.add_composite env id (composite_info_decl su attr')) ({g with gdesc = Gcompositedecl(su, id, attr')} :: accu) gl | Gcompositedef(su, id, attr, fl) -> |