rename Clflags.fast as Clflags.unsafe
The variable and the flag got out in sync in
2977939b5a
.
master
parent
3d0299a185
commit
1ddb7ad725
|
@ -444,7 +444,7 @@ let rec div_int c1 c2 is_safe dbg =
|
||||||
let t = if p > 0 then Cop(Casr, [t; Cconst_int p], dbg) else t in
|
let t = if p > 0 then Cop(Casr, [t; Cconst_int p], dbg) else t in
|
||||||
add_int t (lsr_int c1 (Cconst_int (Nativeint.size - 1)) dbg) dbg)
|
add_int t (lsr_int c1 (Cconst_int (Nativeint.size - 1)) dbg) dbg)
|
||||||
end
|
end
|
||||||
| (c1, c2) when !Clflags.fast || is_safe = Lambda.Unsafe ->
|
| (c1, c2) when !Clflags.unsafe || is_safe = Lambda.Unsafe ->
|
||||||
Cop(Cdivi, [c1; c2], dbg)
|
Cop(Cdivi, [c1; c2], dbg)
|
||||||
| (c1, c2) ->
|
| (c1, c2) ->
|
||||||
bind "divisor" c2 (fun c2 ->
|
bind "divisor" c2 (fun c2 ->
|
||||||
|
@ -480,7 +480,7 @@ let mod_int c1 c2 is_safe dbg =
|
||||||
else
|
else
|
||||||
bind "dividend" c1 (fun c1 ->
|
bind "dividend" c1 (fun c1 ->
|
||||||
sub_int c1 (mul_int (div_int c1 c2 is_safe dbg) c2 dbg) dbg)
|
sub_int c1 (mul_int (div_int c1 c2 is_safe dbg) c2 dbg) dbg)
|
||||||
| (c1, c2) when !Clflags.fast || is_safe = Lambda.Unsafe ->
|
| (c1, c2) when !Clflags.unsafe || is_safe = Lambda.Unsafe ->
|
||||||
(* Flambda already generates that test *)
|
(* Flambda already generates that test *)
|
||||||
Cop(Cmodi, [c1; c2], dbg)
|
Cop(Cmodi, [c1; c2], dbg)
|
||||||
| (c1, c2) ->
|
| (c1, c2) ->
|
||||||
|
|
|
@ -219,7 +219,7 @@ let read_one_param ppf position name v =
|
||||||
| "strict-formats" -> set "strict-formats" [ strict_formats ] v
|
| "strict-formats" -> set "strict-formats" [ strict_formats ] v
|
||||||
| "thread" -> set "thread" [ use_threads ] v
|
| "thread" -> set "thread" [ use_threads ] v
|
||||||
| "unboxed-types" -> set "unboxed-types" [ unboxed_types ] v
|
| "unboxed-types" -> set "unboxed-types" [ unboxed_types ] v
|
||||||
| "unsafe" -> set "unsafe" [ fast ] v
|
| "unsafe" -> set "unsafe" [ unsafe ] v
|
||||||
| "verbose" -> set "verbose" [ verbose ] v
|
| "verbose" -> set "verbose" [ verbose ] v
|
||||||
| "nopervasives" -> set "nopervasives" [ nopervasives ] v
|
| "nopervasives" -> set "nopervasives" [ nopervasives ] v
|
||||||
| "slash" -> set "slash" [ force_slash ] v (* for ocamldep *)
|
| "slash" -> set "slash" [ force_slash ] v (* for ocamldep *)
|
||||||
|
|
|
@ -89,7 +89,7 @@ module Options = Main_args.Make_bytecomp_options (struct
|
||||||
let _vmthread = set use_vmthreads
|
let _vmthread = set use_vmthreads
|
||||||
let _unboxed_types = set unboxed_types
|
let _unboxed_types = set unboxed_types
|
||||||
let _no_unboxed_types = unset unboxed_types
|
let _no_unboxed_types = unset unboxed_types
|
||||||
let _unsafe = set fast
|
let _unsafe = set unsafe
|
||||||
let _unsafe_string = set unsafe_string
|
let _unsafe_string = set unsafe_string
|
||||||
let _use_prims s = use_prims := s
|
let _use_prims s = use_prims := s
|
||||||
let _use_runtime s = use_runtime := s
|
let _use_runtime s = use_runtime := s
|
||||||
|
|
|
@ -174,7 +174,7 @@ module Options = Main_args.Make_optcomp_options (struct
|
||||||
let _unbox_closures_factor f = unbox_closures_factor := f
|
let _unbox_closures_factor f = unbox_closures_factor := f
|
||||||
let _unboxed_types = set unboxed_types
|
let _unboxed_types = set unboxed_types
|
||||||
let _no_unboxed_types = clear unboxed_types
|
let _no_unboxed_types = clear unboxed_types
|
||||||
let _unsafe = set fast
|
let _unsafe = set unsafe
|
||||||
let _unsafe_string = set unsafe_string
|
let _unsafe_string = set unsafe_string
|
||||||
let _v () = print_version_and_library "native-code compiler"
|
let _v () = print_version_and_library "native-code compiler"
|
||||||
let _version () = print_version_string ()
|
let _version () = print_version_string ()
|
||||||
|
|
|
@ -171,7 +171,7 @@ let file_aux ~tool_name inputfile (type a) parse_fun invariant_fun
|
||||||
try
|
try
|
||||||
if is_ast_file then begin
|
if is_ast_file then begin
|
||||||
Location.input_name := (input_value ic : string);
|
Location.input_name := (input_value ic : string);
|
||||||
if !Clflags.fast then
|
if !Clflags.unsafe then
|
||||||
Location.prerr_warning (Location.in_file !Location.input_name)
|
Location.prerr_warning (Location.in_file !Location.input_name)
|
||||||
Warnings.Unsafe_without_parsing;
|
Warnings.Unsafe_without_parsing;
|
||||||
(input_value ic : a)
|
(input_value ic : a)
|
||||||
|
|
|
@ -315,7 +315,7 @@ let rec close t env (lam : Lambda.lambda) : Flambda.t =
|
||||||
| Lprim ((Pdivint Safe | Pmodint Safe
|
| Lprim ((Pdivint Safe | Pmodint Safe
|
||||||
| Pdivbint { is_safe = Safe } | Pmodbint { is_safe = Safe }) as prim,
|
| Pdivbint { is_safe = Safe } | Pmodbint { is_safe = Safe }) as prim,
|
||||||
[arg1; arg2], loc)
|
[arg1; arg2], loc)
|
||||||
when not !Clflags.fast -> (* not -unsafe *)
|
when not !Clflags.unsafe ->
|
||||||
let arg2 = close t env arg2 in
|
let arg2 = close t env arg2 in
|
||||||
let arg1 = close t env arg1 in
|
let arg1 = close t env arg1 in
|
||||||
let numerator = Variable.create Names.numerator in
|
let numerator = Variable.create Names.numerator in
|
||||||
|
@ -374,7 +374,7 @@ let rec close t env (lam : Lambda.lambda) : Flambda.t =
|
||||||
(Prim (prim, [numerator; denominator], dbg))))))))
|
(Prim (prim, [numerator; denominator], dbg))))))))
|
||||||
| Lprim ((Pdivint Safe | Pmodint Safe
|
| Lprim ((Pdivint Safe | Pmodint Safe
|
||||||
| Pdivbint { is_safe = Safe } | Pmodbint { is_safe = Safe }), _, _)
|
| Pdivbint { is_safe = Safe } | Pmodbint { is_safe = Safe }), _, _)
|
||||||
when not !Clflags.fast ->
|
when not !Clflags.unsafe ->
|
||||||
Misc.fatal_error "Pdivint / Pmodint must have exactly two arguments"
|
Misc.fatal_error "Pdivint / Pmodint must have exactly two arguments"
|
||||||
| Lprim (Psequor, [arg1; arg2], _) ->
|
| Lprim (Psequor, [arg1; arg2], _) ->
|
||||||
let arg1 = close t env arg1 in
|
let arg1 = close t env arg1 in
|
||||||
|
|
|
@ -161,7 +161,7 @@ let mkpat_opt_constraint p = function
|
||||||
| Some typ -> mkpat (Ppat_constraint(p, typ))
|
| Some typ -> mkpat (Ppat_constraint(p, typ))
|
||||||
|
|
||||||
let array_function str name =
|
let array_function str name =
|
||||||
ghloc (Ldot(Lident str, (if !Clflags.fast then "unsafe_" ^ name else name)))
|
ghloc (Ldot(Lident str, (if !Clflags.unsafe then "unsafe_" ^ name else name)))
|
||||||
|
|
||||||
let syntax_error () =
|
let syntax_error () =
|
||||||
raise Syntaxerr.Escape_error
|
raise Syntaxerr.Escape_error
|
||||||
|
@ -184,7 +184,7 @@ let bigarray_untuplify = function
|
||||||
| exp -> [exp]
|
| exp -> [exp]
|
||||||
|
|
||||||
let bigarray_get arr arg =
|
let bigarray_get arr arg =
|
||||||
let get = if !Clflags.fast then "unsafe_get" else "get" in
|
let get = if !Clflags.unsafe then "unsafe_get" else "get" in
|
||||||
match bigarray_untuplify arg with
|
match bigarray_untuplify arg with
|
||||||
[c1] ->
|
[c1] ->
|
||||||
mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" get)),
|
mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" get)),
|
||||||
|
@ -200,7 +200,7 @@ let bigarray_get arr arg =
|
||||||
[Nolabel, arr; Nolabel, ghexp(Pexp_array coords)]))
|
[Nolabel, arr; Nolabel, ghexp(Pexp_array coords)]))
|
||||||
|
|
||||||
let bigarray_set arr arg newval =
|
let bigarray_set arr arg newval =
|
||||||
let set = if !Clflags.fast then "unsafe_set" else "set" in
|
let set = if !Clflags.unsafe then "unsafe_set" else "set" in
|
||||||
match bigarray_untuplify arg with
|
match bigarray_untuplify arg with
|
||||||
[c1] ->
|
[c1] ->
|
||||||
mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" set)),
|
mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" set)),
|
||||||
|
|
|
@ -389,7 +389,7 @@ module Options = Main_args.Make_bytetop_options (struct
|
||||||
let _no_strict_formats = clear strict_formats
|
let _no_strict_formats = clear strict_formats
|
||||||
let _unboxed_types = set unboxed_types
|
let _unboxed_types = set unboxed_types
|
||||||
let _no_unboxed_types = clear unboxed_types
|
let _no_unboxed_types = clear unboxed_types
|
||||||
let _unsafe = set fast
|
let _unsafe = set unsafe
|
||||||
let _unsafe_string = set unsafe_string
|
let _unsafe_string = set unsafe_string
|
||||||
let _version () = (* disabled *) ()
|
let _version () = (* disabled *) ()
|
||||||
let _vnum () = (* disabled *) ()
|
let _vnum () = (* disabled *) ()
|
||||||
|
|
|
@ -202,7 +202,7 @@ module Options = Main_args.Make_opttop_options (struct
|
||||||
let _stdin () = file_argument ""
|
let _stdin () = file_argument ""
|
||||||
let _unboxed_types = set unboxed_types
|
let _unboxed_types = set unboxed_types
|
||||||
let _no_unboxed_types = clear unboxed_types
|
let _no_unboxed_types = clear unboxed_types
|
||||||
let _unsafe = set fast
|
let _unsafe = set unsafe
|
||||||
let _verbose = set verbose
|
let _verbose = set verbose
|
||||||
let _version () = print_version ()
|
let _version () = print_version ()
|
||||||
let _vnum () = print_version_num ()
|
let _vnum () = print_version_num ()
|
||||||
|
|
|
@ -129,7 +129,7 @@ module Options = Main_args.Make_bytetop_options (struct
|
||||||
let _no_strict_formats = clear strict_formats
|
let _no_strict_formats = clear strict_formats
|
||||||
let _unboxed_types = set unboxed_types
|
let _unboxed_types = set unboxed_types
|
||||||
let _no_unboxed_types = clear unboxed_types
|
let _no_unboxed_types = clear unboxed_types
|
||||||
let _unsafe = set fast
|
let _unsafe = set unsafe
|
||||||
let _unsafe_string = set unsafe_string
|
let _unsafe_string = set unsafe_string
|
||||||
let _version () = print_version ()
|
let _version () = print_version ()
|
||||||
let _vnum () = print_version_num ()
|
let _vnum () = print_version_num ()
|
||||||
|
|
|
@ -49,7 +49,7 @@ and no_std_include = ref false (* -nostdlib *)
|
||||||
and print_types = ref false (* -i *)
|
and print_types = ref false (* -i *)
|
||||||
and make_archive = ref false (* -a *)
|
and make_archive = ref false (* -a *)
|
||||||
and debug = ref false (* -g *)
|
and debug = ref false (* -g *)
|
||||||
and fast = ref false (* -unsafe *)
|
and unsafe = ref false (* -unsafe *)
|
||||||
and use_linscan = ref false (* -linscan *)
|
and use_linscan = ref false (* -linscan *)
|
||||||
and link_everything = ref false (* -linkall *)
|
and link_everything = ref false (* -linkall *)
|
||||||
and custom_runtime = ref false (* -custom *)
|
and custom_runtime = ref false (* -custom *)
|
||||||
|
|
|
@ -76,7 +76,7 @@ val no_std_include : bool ref
|
||||||
val print_types : bool ref
|
val print_types : bool ref
|
||||||
val make_archive : bool ref
|
val make_archive : bool ref
|
||||||
val debug : bool ref
|
val debug : bool ref
|
||||||
val fast : bool ref
|
val unsafe : bool ref
|
||||||
val use_linscan : bool ref
|
val use_linscan : bool ref
|
||||||
val link_everything : bool ref
|
val link_everything : bool ref
|
||||||
val custom_runtime : bool ref
|
val custom_runtime : bool ref
|
||||||
|
|
Loading…
Reference in New Issue