aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Driver.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-03-20 11:25:30 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-03-20 11:25:30 +0100
commitcbf8434e44ebd6bc05022d1fbe0400267520184f (patch)
treea73d9d6d0601935cf514698cdc393d131df7a341 /driver/Driver.ml
parent42e397bd80389c7e7259f962415769b06561bb5d (diff)
downloadcompcert-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/Driver.ml')
-rw-r--r--driver/Driver.ml23
1 files changed, 12 insertions, 11 deletions
diff --git a/driver/Driver.ml b/driver/Driver.ml
index e3ad4549..ad7cf61e 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -558,22 +558,25 @@ let cmdline_actions =
Exact "-all", Self (fun _ -> Interp.mode := Interp.All);
(* Special -f options *)
Exact "-fstruct-passing=ref-callee",
- Self (fun _ -> option_fstruct_passing_style := Some Machine.SP_ref_callee);
+ Self (fun _ -> option_fstruct_passing_style := Configuration.SP_ref_callee);
Exact "-fstruct-passing=ref-caller",
Self (fun _ -> option_fstruct_return := true;
- option_fstruct_passing_style := Some Machine.SP_ref_caller);
+ option_fstruct_passing_style := Configuration.SP_ref_caller);
Exact "-fstruct-passing=ints",
Self (fun _ -> option_fstruct_return := true;
- option_fstruct_passing_style := Some Machine.SP_split_args);
+ option_fstruct_passing_style := Configuration.SP_split_args);
Exact "-fstruct-return=ref",
Self (fun _ -> option_fstruct_return := true;
- option_fstruct_return_style := Some 0);
- Exact "-fstruct-return=int4",
+ option_fstruct_return_style := Configuration.SR_ref);
+ Exact "-fstruct-return=int1248",
Self (fun _ -> option_fstruct_return := true;
- option_fstruct_return_style := Some 4);
- Exact "-fstruct-return=int8",
+ option_fstruct_return_style := Configuration.SR_int1248);
+ Exact "-fstruct-return=int1-4",
Self (fun _ -> option_fstruct_return := true;
- option_fstruct_return_style := Some 8)
+ option_fstruct_return_style := Configuration.SR_int1to4);
+ Exact "-fstruct-return=int1-8",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_return_style := Configuration.SR_int1to8)
]
(* -f options: come in -f and -fno- variants *)
(* Language support options *)
@@ -628,9 +631,7 @@ let _ =
Printexc.record_backtrace true;
Machine.config :=
begin match Configuration.arch with
- | "powerpc" -> if Configuration.abi = "linux"
- then Machine.ppc_32_bigendian_linux
- else Machine.ppc_32_bigendian
+ | "powerpc" -> Machine.ppc_32_bigendian
| "arm" -> Machine.arm_littleendian
| "ia32" -> if Configuration.abi = "macosx"
then Machine.x86_32_macosx