diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2015-03-20 11:25:30 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2015-03-20 11:25:30 +0100 |
commit | cbf8434e44ebd6bc05022d1fbe0400267520184f (patch) | |
tree | a73d9d6d0601935cf514698cdc393d131df7a341 /driver/Configuration.ml | |
parent | 42e397bd80389c7e7259f962415769b06561bb5d (diff) | |
download | compcert-cbf8434e44ebd6bc05022d1fbe0400267520184f.tar.gz compcert-cbf8434e44ebd6bc05022d1fbe0400267520184f.zip |
Improvements in the StructReturn transformation (ABI conformance for passing composites).
- Implement the "1/2/4/8" composite return policy, used by IA32/MacOS X and IA32/BSD.
- Move the default passing conventions from Machine.ml to compcert.ini, making it easier to test the various conventions.
- More comprehensive interoperability test in regression/interop1.c.
Diffstat (limited to 'driver/Configuration.ml')
-rw-r--r-- | driver/Configuration.ml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/driver/Configuration.ml b/driver/Configuration.ml index 0012dc0c..237085de 100644 --- a/driver/Configuration.ml +++ b/driver/Configuration.ml @@ -94,3 +94,30 @@ let asm_supports_cfi = | v -> bad_config "asm_supports_cfi" [v] let version = get_config_string "version" + +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 *) + +let struct_passing_style = + match get_config_string "struct_passing_style" with + | "ref-callee" -> SP_ref_callee + | "ref-caller" -> SP_ref_caller + | "ints" -> SP_split_args + | v -> bad_config "struct_passing_style" [v] + +let struct_return_style = + match get_config_string "struct_return_style" with + | "int1248" -> SR_int1248 + | "int1-4" -> SR_int1to4 + | "int1-8" -> SR_int1to8 + | "ref" -> SR_ref + | v -> bad_config "struct_return_style" [v] |