rename Clflags.fast as Clflags.unsafe

The variable and the flag got out in sync in
2977939b5a.
master
Valentin Gatien-Baron 2018-07-15 15:01:26 -04:00
parent 3d0299a185
commit 1ddb7ad725
12 changed files with 16 additions and 16 deletions

View File

@ -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
add_int t (lsr_int c1 (Cconst_int (Nativeint.size - 1)) dbg) dbg)
end
| (c1, c2) when !Clflags.fast || is_safe = Lambda.Unsafe ->
| (c1, c2) when !Clflags.unsafe || is_safe = Lambda.Unsafe ->
Cop(Cdivi, [c1; c2], dbg)
| (c1, c2) ->
bind "divisor" c2 (fun c2 ->
@ -480,7 +480,7 @@ let mod_int c1 c2 is_safe dbg =
else
bind "dividend" c1 (fun c1 ->
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 *)
Cop(Cmodi, [c1; c2], dbg)
| (c1, c2) ->

View File

@ -219,7 +219,7 @@ let read_one_param ppf position name v =
| "strict-formats" -> set "strict-formats" [ strict_formats ] v
| "thread" -> set "thread" [ use_threads ] v
| "unboxed-types" -> set "unboxed-types" [ unboxed_types ] v
| "unsafe" -> set "unsafe" [ fast ] v
| "unsafe" -> set "unsafe" [ unsafe ] v
| "verbose" -> set "verbose" [ verbose ] v
| "nopervasives" -> set "nopervasives" [ nopervasives ] v
| "slash" -> set "slash" [ force_slash ] v (* for ocamldep *)

View File

@ -89,7 +89,7 @@ module Options = Main_args.Make_bytecomp_options (struct
let _vmthread = set use_vmthreads
let _unboxed_types = set unboxed_types
let _no_unboxed_types = unset unboxed_types
let _unsafe = set fast
let _unsafe = set unsafe
let _unsafe_string = set unsafe_string
let _use_prims s = use_prims := s
let _use_runtime s = use_runtime := s

View File

@ -174,7 +174,7 @@ module Options = Main_args.Make_optcomp_options (struct
let _unbox_closures_factor f = unbox_closures_factor := f
let _unboxed_types = set unboxed_types
let _no_unboxed_types = clear unboxed_types
let _unsafe = set fast
let _unsafe = set unsafe
let _unsafe_string = set unsafe_string
let _v () = print_version_and_library "native-code compiler"
let _version () = print_version_string ()

View File

@ -171,7 +171,7 @@ let file_aux ~tool_name inputfile (type a) parse_fun invariant_fun
try
if is_ast_file then begin
Location.input_name := (input_value ic : string);
if !Clflags.fast then
if !Clflags.unsafe then
Location.prerr_warning (Location.in_file !Location.input_name)
Warnings.Unsafe_without_parsing;
(input_value ic : a)

View File

@ -315,7 +315,7 @@ let rec close t env (lam : Lambda.lambda) : Flambda.t =
| Lprim ((Pdivint Safe | Pmodint Safe
| Pdivbint { is_safe = Safe } | Pmodbint { is_safe = Safe }) as prim,
[arg1; arg2], loc)
when not !Clflags.fast -> (* not -unsafe *)
when not !Clflags.unsafe ->
let arg2 = close t env arg2 in
let arg1 = close t env arg1 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))))))))
| Lprim ((Pdivint Safe | Pmodint 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"
| Lprim (Psequor, [arg1; arg2], _) ->
let arg1 = close t env arg1 in

View File

@ -161,7 +161,7 @@ let mkpat_opt_constraint p = function
| Some typ -> mkpat (Ppat_constraint(p, typ))
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 () =
raise Syntaxerr.Escape_error
@ -184,7 +184,7 @@ let bigarray_untuplify = function
| exp -> [exp]
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
[c1] ->
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)]))
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
[c1] ->
mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" set)),

View File

@ -389,7 +389,7 @@ module Options = Main_args.Make_bytetop_options (struct
let _no_strict_formats = clear strict_formats
let _unboxed_types = set unboxed_types
let _no_unboxed_types = clear unboxed_types
let _unsafe = set fast
let _unsafe = set unsafe
let _unsafe_string = set unsafe_string
let _version () = (* disabled *) ()
let _vnum () = (* disabled *) ()

View File

@ -202,7 +202,7 @@ module Options = Main_args.Make_opttop_options (struct
let _stdin () = file_argument ""
let _unboxed_types = set unboxed_types
let _no_unboxed_types = clear unboxed_types
let _unsafe = set fast
let _unsafe = set unsafe
let _verbose = set verbose
let _version () = print_version ()
let _vnum () = print_version_num ()

View File

@ -129,7 +129,7 @@ module Options = Main_args.Make_bytetop_options (struct
let _no_strict_formats = clear strict_formats
let _unboxed_types = set unboxed_types
let _no_unboxed_types = clear unboxed_types
let _unsafe = set fast
let _unsafe = set unsafe
let _unsafe_string = set unsafe_string
let _version () = print_version ()
let _vnum () = print_version_num ()

View File

@ -49,7 +49,7 @@ and no_std_include = ref false (* -nostdlib *)
and print_types = ref false (* -i *)
and make_archive = ref false (* -a *)
and debug = ref false (* -g *)
and fast = ref false (* -unsafe *)
and unsafe = ref false (* -unsafe *)
and use_linscan = ref false (* -linscan *)
and link_everything = ref false (* -linkall *)
and custom_runtime = ref false (* -custom *)

View File

@ -76,7 +76,7 @@ val no_std_include : bool ref
val print_types : bool ref
val make_archive : bool ref
val debug : bool ref
val fast : bool ref
val unsafe : bool ref
val use_linscan : bool ref
val link_everything : bool ref
val custom_runtime : bool ref