diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-28 08:47:43 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-28 08:47:43 +0000 |
commit | 8d7c806e16b98781a3762b5680b4dc64764da1b8 (patch) | |
tree | 82fb3ecd34e451e4e96f57e2103a694c9acc0830 /cparser/Elab.ml | |
parent | ad12162ff1f0d50c43afefc45e1593f27f197402 (diff) | |
download | compcert-kvx-8d7c806e16b98781a3762b5680b4dc64764da1b8.tar.gz compcert-kvx-8d7c806e16b98781a3762b5680b4dc64764da1b8.zip |
Simpler, more robust emulation of calls to variadic functions:
- C function types and Cminor signatures annotated by calling conventions.
esp. vararg / not vararg
- Cshmgen: generate correct code for function call where there are
more arguments than listed in the function prototype. This is
still undefined behavior according to the formal semantics,
but correct code is generated.
- C2C, */PrintAsm.ml: remove "printf$iif" hack.
- powerpc/, checklink/: don't generate stubs for variadic functions.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2386 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index d0e1b284..313569b6 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1567,9 +1567,9 @@ let elab_fundef env (spec, name) body loc1 loc2 = | TFun(ty_ret, None, vararg, attr) -> TFun(ty_ret, Some [], vararg, attr) | _ -> ty in (* Extract info from type *) - let (ty_ret, params, vararg) = + let (ty_ret, params, vararg, attr) = match ty with - | TFun(ty_ret, Some params, vararg, attr) -> (ty_ret, params, vararg) + | TFun(ty_ret, Some params, vararg, attr) -> (ty_ret, params, vararg, attr) | _ -> fatal_error loc1 "wrong type for function definition" in (* Enter function in the environment, for recursive references *) let (fun_id, env1) = enter_or_refine_ident false loc1 env s sto ty in @@ -1584,6 +1584,7 @@ let elab_fundef env (spec, name) body loc1 loc2 = { fd_storage = sto; fd_inline = inline; fd_name = fun_id; + fd_attrib = attr; fd_ret = ty_ret; fd_params = params; fd_vararg = vararg; |