From e096fa7aa6161e1f5a74001185eb3873a684c48d Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 27 Jan 2015 16:57:20 +0100 Subject: ABI compatibility for struct/union function arguments passed by value. The passing of struct/union arguments by value implemented in the verified part of CompCert is not compatible with the ARM, PowerPC and x86 ABI. Here we enrich the StructReturn source-to-source emulation pass so that it implements the calling conventions defined in these ABIs. Plus: for x86, implement the returning of struct/union results by value in a way compatible with the ABI. --- cparser/Cutil.mli | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cparser/Cutil.mli') diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index b90dc897..deee9f08 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -210,6 +210,8 @@ val eassign : exp -> exp -> exp (* Expression for [e1 = e2] *) val ecomma : exp -> exp -> exp (* Expression for [e1, e2] *) +val ecommalist : exp list -> exp -> exp + (* Expression for [e1, ..., eN, e] *) val sskip: stmt (* The [skip] statement. No location. *) val sseq : location -> stmt -> stmt -> stmt @@ -232,3 +234,10 @@ val formatloc: Format.formatter -> location -> unit val default_init: Env.t -> typ -> init (* Return a default initializer for the given type (with zero numbers, null pointers, etc). *) + +(* Substitution of variables by expressions *) + +val subst_expr: exp IdentMap.t -> exp -> exp +val subst_init: exp IdentMap.t -> init -> init +val subst_decl: exp IdentMap.t -> decl -> decl +val subst_stmt: exp IdentMap.t -> stmt -> stmt -- cgit