From 1099583341e3a218accf80391202a7e5390f54cc Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 16 Feb 2018 13:12:20 +0100 Subject: Move struct passing/return style to Machine. Since the used configuration for passing and returning values struct values is pretty much static it can be hardwired into the machine settings. --- cparser/Machine.mli | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cparser/Machine.mli') diff --git a/cparser/Machine.mli b/cparser/Machine.mli index b971958d..53c13b52 100644 --- a/cparser/Machine.mli +++ b/cparser/Machine.mli @@ -14,6 +14,17 @@ (* *********************************************************************) (* Machine-dependent aspects *) +type struct_passing_style = + | SP_ref_callee (* by reference, callee takes copy *) + | SP_ref_caller (* by reference, caller takes copy *) + | SP_split_args (* by value, as a sequence of ints *) + +type struct_return_style = + | SR_int1248 (* return by content if size is 1, 2, 4 or 8 bytes *) + | SR_int1to4 (* return by content if size is <= 4 *) + | SR_int1to8 (* return by content if size is <= 8 *) + | SR_ref (* always return by assignment to a reference + given as extra argument *) type t = { name: string; @@ -44,7 +55,9 @@ type t = { alignof_fun: int option; bigendian: bool; bitfields_msb_first: bool; - supports_unaligned_accesses: bool + supports_unaligned_accesses: bool; + struct_passing_style: struct_passing_style; + struct_return_style: struct_return_style; } (* The current configuration *) @@ -58,11 +71,13 @@ val i32lpll64 : t val il32pll64 : t val x86_32 : t val x86_32_macosx : t +val x86_32_bsd : t val x86_64 : t val win32 : t val win64 : t val ppc_32_bigendian : t val ppc_32_diab_bigendian : t +val ppc_32_linux_bigendian : t val arm_littleendian : t val arm_bigendian : t val rv32 : t -- cgit