aboutsummaryrefslogtreecommitdiffstats
path: root/exportclight
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2018-01-11 15:15:43 +0100
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-01-11 15:15:43 +0100
commita6038ae9bae41526224c2416332c719f26261812 (patch)
treea3746c1dcf07e2e17c1e5da27c36ec43eeeeef5b /exportclight
parentd39a9b5eac9369a91d75b9a170c5590a976671e4 (diff)
downloadcompcert-kvx-a6038ae9bae41526224c2416332c719f26261812.tar.gz
compcert-kvx-a6038ae9bae41526224c2416332c719f26261812.zip
Move machine initialization to Frontend.init function. (#49)
The initialization of Machine.config, as well as the calls to various initialization functions for the C front-end, are now performed by the new `Frontend.init` function. This avoids code duplication in driver/Driver.ml and exportclight/Clightgen.ml.
Diffstat (limited to 'exportclight')
-rw-r--r--exportclight/Clightgen.ml21
1 files changed, 1 insertions, 20 deletions
diff --git a/exportclight/Clightgen.ml b/exportclight/Clightgen.ml
index 9bac7a60..432346a5 100644
--- a/exportclight/Clightgen.ml
+++ b/exportclight/Clightgen.ml
@@ -206,26 +206,7 @@ let _ =
Gc.major_heap_increment = 4194304 (* 4M *)
};
Printexc.record_backtrace true;
- Machine.config :=
- begin match Configuration.arch with
- | "powerpc" -> Machine.ppc_32_bigendian
- | "arm" -> if Configuration.is_big_endian
- then Machine.arm_bigendian
- else Machine.arm_littleendian
- | "x86" -> if Configuration.model = "64" then
- Machine.x86_64
- else
- if Configuration.abi = "macosx"
- then Machine.x86_32_macosx
- else Machine.x86_32
- | "riscV" -> if Configuration.model = "64"
- then Machine.rv64
- else Machine.rv32
- | _ -> assert false
- end;
- Builtins.set C2C.builtins;
- Cutil.declare_attributes C2C.attributes;
- CPragmas.initialize();
+ Frontend.init ();
parse_cmdline cmdline_actions;
if !option_o <> None && !num_input_files >= 2 then begin
eprintf "Ambiguous '-o' option (multiple source files)\n";