summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2007-06-04 16:23:09 +0000
committerAlain Frisch <alain@frisch.fr>2007-06-04 16:23:09 +0000
commit0aa1d9acd5ddf01bb0ad30f01ed68e262453a52d (patch)
tree999e4e9fd1e0d3227338b7fa7d79aafa9d595b1c
parent5f8b62199029efdc424b166364b58bc8da8e2c4a (diff)
downloadocaml-0aa1d9acd5ddf01bb0ad30f01ed68e262453a52d.tar.gz
-dlcode option
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/natdynlink@8313 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--asmcomp/amd64/proc.ml2
-rw-r--r--asmcomp/amd64/selection.ml2
-rw-r--r--driver/optmain.ml2
-rw-r--r--utils/clflags.ml1
-rw-r--r--utils/clflags.mli2
5 files changed, 6 insertions, 3 deletions
diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml
index 57389ff5e0..cf274cdf8d 100644
--- a/asmcomp/amd64/proc.ml
+++ b/asmcomp/amd64/proc.ml
@@ -170,7 +170,7 @@ let destroyed_at_oper = function
| Iop(Istore(Single, _)) -> [| rxmm15 |]
| Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _))
-> [| rax |]
- | Iswitch(_, _) when !pic_code || !dlcode -> [| r11 |]
+ | Iswitch(_, _) when !pic_code || !Clflags.dlcode -> [| r11 |]
| _ -> [||]
let destroyed_at_raise = all_phys_regs
diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml
index 6a93b362d2..c4f4e0a23f 100644
--- a/asmcomp/amd64/selection.ml
+++ b/asmcomp/amd64/selection.ml
@@ -32,7 +32,7 @@ type addressing_expr =
let rec select_addr exp =
match exp with
- Cconst_symbol s when not !dlcode ->
+ Cconst_symbol s when not Clflags.!dlcode ->
(Asymbol s, 0)
| Cop((Caddi | Cadda), [arg; Cconst_int m]) ->
let (a, n) = select_addr arg in (a, n + m)
diff --git a/driver/optmain.ml b/driver/optmain.ml
index 98ee6ea6b4..bf90ef6aec 100644
--- a/driver/optmain.ml
+++ b/driver/optmain.ml
@@ -106,6 +106,8 @@ let main () =
" Optimize code size rather than speed";
"-config", Arg.Unit show_config,
" print configuration values and exit";
+ "-dlcode", Arg.Set dlcode,
+ " Compile into code that can be dynlinked";
"-dtypes", Arg.Set save_types,
" Save type information in <filename>.annot";
"-for-pack", Arg.String (fun s -> for_package := Some s),
diff --git a/utils/clflags.ml b/utils/clflags.ml
index 67bee5dabe..03b45957b9 100644
--- a/utils/clflags.ml
+++ b/utils/clflags.ml
@@ -90,4 +90,5 @@ let std_include_dir () =
;;
let shared = ref false (* -shared *)
+let dlcode = ref false (* -dlcode *)
diff --git a/utils/clflags.mli b/utils/clflags.mli
index 6b66715814..01f4d520d7 100644
--- a/utils/clflags.mli
+++ b/utils/clflags.mli
@@ -74,4 +74,4 @@ val dont_write_files : bool ref
val std_include_flag : string -> string
val std_include_dir : unit -> string list
val shared : bool ref
-
+val dlcode : bool ref