Skip to content

Commit

Permalink
Whitespace and overlong line fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jun 13, 2018
1 parent 9924db8 commit fc36b23
Show file tree
Hide file tree
Showing 248 changed files with 983 additions and 660 deletions.
18 changes: 10 additions & 8 deletions Changes
Expand Up @@ -182,8 +182,8 @@ OCaml 4.07
- GPR#1638: add a Float module.
(Nicolás Ojeda Bär, review by Alain Frisch and Jeremy Yallop)

- GPR#1697: Tune [List.init] tailrec threshold so that it does not stack overflow
when compiled with the Js_of_ocaml backend.
- GPR#1697: Tune [List.init] tailrec threshold so that it does not stack
overflow when compiled with the Js_of_ocaml backend.
(Hugo Heuzard, reviewed by Gabriel Scherer)

### Other libraries:
Expand Down Expand Up @@ -263,8 +263,8 @@ OCaml 4.07
- GPR#1618: add the -dno-unique-ids and -dunique-ids compiler flags
(Sébastien Hinderer, review by Leo White and Damien Doligez)

- GPR#1649 change compilation order of toplevel definitions, so that some warnings
emitted by the bytecode compiler appear more in-order than before.
- GPR#1649 change compilation order of toplevel definitions, so that some
warnings emitted by the bytecode compiler appear more in-order than before.
(Luc Maranget, advice and review by Damien Doligez)

- GPR#1806: add linscan to OCAMLPARAM options
Expand Down Expand Up @@ -482,7 +482,8 @@ OCaml 4.07

- GPR#1513: Allow compilation units to shadow sub-modules of Pervasives.
For instance users can now use a largeFile.ml file in their project.
(Jérémie Dimino, review by Nicolas Ojeda Bar, Alain Frisch and Gabriel Radanne)
(Jérémie Dimino, review by Nicolas Ojeda Bar, Alain Frisch and Gabriel
Radanne)

- GPR#1516: Allow float array construction in recursive bindings
when configured with -no-flat-float-array
Expand Down Expand Up @@ -839,9 +840,10 @@ OCaml 4.06.0 (3 Nov 2017):
pretty-printing items. New fields have been added to the
formatter_out_functions record, thus this change will break any code building
such record from scratch.
When building Format.formatter_out_functions values redefining the out_spaces field,
"{ fmt_out_funs with out_spaces = f; }" should be replaced by
"{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old behavior.
When building Format.formatter_out_functions values redefining the out_spaces
field, "{ fmt_out_funs with out_spaces = f; }" should be replaced by
"{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old
behavior.
(Richard Bonichon and Pierre Weis, review by Alain Frisch, original request by
Spiros Eliopoulos in GPR#506)

Expand Down
24 changes: 16 additions & 8 deletions README.adoc
@@ -1,14 +1,22 @@
|=====
| Branch `trunk` | Branch `4.06` | Branch `4.05` | Branch `4.04`

| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.06["TravisCI Build Status (4.06 branch)",link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.06&svg=true["AppVeyor Build Status (4.06 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.05["TravisCI Build Status (4.05 branch)",link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.05&svg=true["AppVeyor Build Status (4.05 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.04["TravisCI Build Status (4.04 branch)",link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.04&svg=true["AppVeyor Build Status (4.04 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.06["TravisCI Build Status (4.06 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.06&svg=true["AppVeyor Build Status (4.06 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.05["TravisCI Build Status (4.05 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.05&svg=true["AppVeyor Build Status (4.05 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.04["TravisCI Build Status (4.04 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.04&svg=true["AppVeyor Build Status (4.04 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]

|=====

Expand Down
2 changes: 1 addition & 1 deletion README.win32.adoc
Expand Up @@ -96,7 +96,7 @@ Visual C/C++ Compiler as well as the Build Tools for Visual Studio.

|=====
| | `cl` Version | Express | SDK/Build Tools
| Visual Studio 2005 | 14.00.x.x | 32-bit only <<vs1,(*)>> |
| Visual Studio 2005 | 14.00.x.x | 32-bit only <<vs1,(*)>> |
| Visual Studio 2008 | 15.00.x.x | 32-bit only | Windows SDK 7.0 also provides 32/64-bit compilers
| Visual Studio 2010 | 16.00.x.x | 32-bit only | Windows SDK 7.1 also provides 32/64-bit compilers
| Visual Studio 2012 | 17.00.x.x | 32/64-bit |
Expand Down
6 changes: 3 additions & 3 deletions asmcomp/arm/reload.ml
Expand Up @@ -44,9 +44,9 @@ method! reload_operation op arg res =
| Iabsf | Inegf when !fpu = Soft ->
(* Soft FP neg and abs also have a "two-address" constraint of sorts.
64-bit floats are represented by pairs of 32-bit integers,
hence there are two arguments and two results.
The code emitter assumes [arg.(0) = res.(0)] but supports
[arg.(1)] and [res.(1)] being in different registers. *)
hence there are two arguments and two results.
The code emitter assumes [arg.(0) = res.(0)] but supports
[arg.(1)] and [res.(1)] being in different registers. *)
res'.(0) <- arg'.(0);
argres'
| _ ->
Expand Down
3 changes: 2 additions & 1 deletion asmcomp/asmlink.ml
Expand Up @@ -353,7 +353,8 @@ let link ppf objfiles output_name =
(fun () -> make_startup_file ppf units_tolink);
Misc.try_finally
(fun () ->
call_linker (List.map object_file_name objfiles) startup_obj output_name)
call_linker (List.map object_file_name objfiles)
startup_obj output_name)
(fun () -> remove_file startup_obj)
)

Expand Down
12 changes: 6 additions & 6 deletions asmcomp/build_export_info.ml
Expand Up @@ -652,13 +652,14 @@ let build_transient ~(backend : (module Backend_intf.S))
let closure_id_to_set_of_closures_id =
Set_of_closures_id.Map.fold
(fun set_of_closure_id
(function_declarations : Simple_value_approx.function_declarations) acc ->
Variable.Map.fold
(fun fun_var _ acc ->
(function_declarations : Simple_value_approx.function_declarations)
acc ->
Variable.Map.fold
(fun fun_var _ acc ->
let closure_id = Closure_id.wrap fun_var in
Closure_id.Map.add closure_id set_of_closure_id acc)
function_declarations.funs
acc)
function_declarations.funs
acc)
function_declarations_map
Closure_id.Map.empty
in
Expand Down Expand Up @@ -710,4 +711,3 @@ let build_transient ~(backend : (module Backend_intf.S))
~relevant_imported_closure_ids
~relevant_local_vars_within_closure
~relevant_imported_vars_within_closure

11 changes: 8 additions & 3 deletions asmcomp/closure.ml
Expand Up @@ -645,19 +645,24 @@ let rec substitute loc fpc sb rn ulam =
(fun id id' s -> Tbl.add id (Uvar id') s)
ids ids' sb
in
Ucatch(nfail, ids', substitute loc fpc sb rn u1, substitute loc fpc sb' rn u2)
Ucatch(nfail, ids', substitute loc fpc sb rn u1,
substitute loc fpc sb' rn u2)
| Utrywith(u1, id, u2) ->
let id' = Ident.rename id in
Utrywith(substitute loc fpc sb rn u1, id',
substitute loc fpc (Tbl.add id (Uvar id') sb) rn u2)
| Uifthenelse(u1, u2, u3) ->
begin match substitute loc fpc sb rn u1 with
Uconst (Uconst_ptr n) ->
if n <> 0 then substitute loc fpc sb rn u2 else substitute loc fpc sb rn u3
if n <> 0 then
substitute loc fpc sb rn u2
else
substitute loc fpc sb rn u3
| Uprim(Pmakeblock _, _, _) ->
substitute loc fpc sb rn u2
| su1 ->
Uifthenelse(su1, substitute loc fpc sb rn u2, substitute loc fpc sb rn u3)
Uifthenelse(su1, substitute loc fpc sb rn u2,
substitute loc fpc sb rn u3)
end
| Usequence(u1, u2) ->
Usequence(substitute loc fpc sb rn u1, substitute loc fpc sb rn u2)
Expand Down
41 changes: 25 additions & 16 deletions asmcomp/cmmgen.ml
Expand Up @@ -612,7 +612,7 @@ let set_field ptr n newval init dbg =
Cop(Cstore (Word_val, init), [field_address ptr n dbg; newval], dbg)

let non_profinfo_mask =
if Config.profinfo
if Config.profinfo
then (1 lsl (64 - Config.profinfo_width)) - 1
else 0 (* [non_profinfo_mask] is unused in this case *)

Expand Down Expand Up @@ -1106,13 +1106,14 @@ let bigarray_get unsafe elt_kind layout b args dbg =
Pbigarray_complex32 | Pbigarray_complex64 ->
let kind = bigarray_word_kind elt_kind in
let sz = bigarray_elt_size elt_kind / 2 in
bind "addr" (bigarray_indexing unsafe elt_kind layout b args dbg) (fun addr ->
bind "reval"
(Cop(Cload (kind, Mutable), [addr], dbg)) (fun reval ->
bind "imval"
(Cop(Cload (kind, Mutable),
[Cop(Cadda, [addr; Cconst_int sz], dbg)], dbg)) (fun imval ->
box_complex dbg reval imval)))
bind "addr"
(bigarray_indexing unsafe elt_kind layout b args dbg) (fun addr ->
bind "reval"
(Cop(Cload (kind, Mutable), [addr], dbg)) (fun reval ->
bind "imval"
(Cop(Cload (kind, Mutable),
[Cop(Cadda, [addr; Cconst_int sz], dbg)], dbg))
(fun imval -> box_complex dbg reval imval)))
| _ ->
Cop(Cload (bigarray_word_kind elt_kind, Mutable),
[bigarray_indexing unsafe elt_kind layout b args dbg],
Expand Down Expand Up @@ -2081,7 +2082,8 @@ and transl_prim_1 env p arg dbg =
bind "header" hdr (fun hdr ->
Cifthenelse(is_addr_array_hdr hdr dbg,
Cop(Clsr, [hdr; Cconst_int wordsize_shift], dbg),
Cop(Clsr, [hdr; Cconst_int numfloat_shift], dbg))) in
Cop(Clsr, [hdr; Cconst_int numfloat_shift], dbg)))
in
Cop(Cor, [len; Cconst_int 1], dbg)
| Paddrarray | Pintarray ->
Cop(Cor, [addr_array_length hdr dbg; Cconst_int 1], dbg)
Expand Down Expand Up @@ -2213,23 +2215,28 @@ and transl_prim_2 env p arg1 arg2 dbg =
(* Float operations *)
| Paddfloat ->
box_float dbg (Cop(Caddf,
[transl_unbox_float dbg env arg1; transl_unbox_float dbg env arg2],
[transl_unbox_float dbg env arg1;
transl_unbox_float dbg env arg2],
dbg))
| Psubfloat ->
box_float dbg (Cop(Csubf,
[transl_unbox_float dbg env arg1; transl_unbox_float dbg env arg2],
[transl_unbox_float dbg env arg1;
transl_unbox_float dbg env arg2],
dbg))
| Pmulfloat ->
box_float dbg (Cop(Cmulf,
[transl_unbox_float dbg env arg1; transl_unbox_float dbg env arg2],
[transl_unbox_float dbg env arg1;
transl_unbox_float dbg env arg2],
dbg))
| Pdivfloat ->
box_float dbg (Cop(Cdivf,
[transl_unbox_float dbg env arg1; transl_unbox_float dbg env arg2],
[transl_unbox_float dbg env arg1;
transl_unbox_float dbg env arg2],
dbg))
| Pfloatcomp cmp ->
tag_int(Cop(Ccmpf(transl_float_comparison cmp),
[transl_unbox_float dbg env arg1; transl_unbox_float dbg env arg2],
[transl_unbox_float dbg env arg1;
transl_unbox_float dbg env arg2],
dbg)) dbg

(* String operations *)
Expand Down Expand Up @@ -2404,7 +2411,8 @@ and transl_prim_2 env p arg1 arg2 dbg =
untag_int(transl env arg2) dbg], dbg))
| Plsrbint bi ->
box_int dbg bi (Cop(Clsr,
[make_unsigned_int bi (transl_unbox_int dbg env bi arg1) dbg;
[make_unsigned_int bi (transl_unbox_int dbg env bi arg1)
dbg;
untag_int(transl env arg2) dbg], dbg))
| Pasrbint bi ->
box_int dbg bi (Cop(Casr,
Expand Down Expand Up @@ -3331,7 +3339,8 @@ let final_curry_function arity =
let newclos = Ident.create "clos" in
Clet(newclos,
get_field env (Cvar clos) 4 dbg,
curry_fun (get_field env (Cvar clos) 3 dbg :: args) newclos (n-1))
curry_fun (get_field env (Cvar clos) 3 dbg :: args)
newclos (n-1))
end in
Cfunction
{fun_name = "caml_curry" ^ string_of_int arity ^
Expand Down
4 changes: 3 additions & 1 deletion asmcomp/export_info.ml
Expand Up @@ -277,7 +277,9 @@ let merge (t1 : t) (t2 : t) : t =
sets_of_closures =
Set_of_closures_id.Map.disjoint_union t1.sets_of_closures
t2.sets_of_closures;
symbol_id = Symbol.Map.disjoint_union ~print:Export_id.print t1.symbol_id t2.symbol_id;
symbol_id =
Symbol.Map.disjoint_union ~print:Export_id.print t1.symbol_id
t2.symbol_id;
offset_fun = Closure_id.Map.disjoint_union
~eq:int_eq t1.offset_fun t2.offset_fun;
offset_fv = Var_within_closure.Map.disjoint_union
Expand Down
6 changes: 4 additions & 2 deletions asmcomp/flambda_to_clambda.ml
Expand Up @@ -24,8 +24,10 @@ type 'a for_one_or_more_units = {
}

type t = {
current_unit : Set_of_closures_id.t for_one_or_more_units;
imported_units : Simple_value_approx.function_declarations for_one_or_more_units;
current_unit :
Set_of_closures_id.t for_one_or_more_units;
imported_units :
Simple_value_approx.function_declarations for_one_or_more_units;
}

let get_fun_offset t closure_id =
Expand Down
3 changes: 2 additions & 1 deletion asmcomp/linscan.ml
Expand Up @@ -113,7 +113,8 @@ let allocate_free_register i =
(* Remove all overlapping registers from the register mask *)
let remove_bound_overlapping = function
{reg = {loc = Reg r}} as j ->
if (r - r0 < rn) && regmask.(r - r0) && Interval.overlap j i then
if (r - r0 < rn) && regmask.(r - r0)
&& Interval.overlap j i then
regmask.(r - r0) <- false
| _ -> () in
List.iter remove_bound_overlapping ci.ci_inactive;
Expand Down
3 changes: 2 additions & 1 deletion asmcomp/split.ml
Expand Up @@ -171,7 +171,8 @@ let rec rename i sub =
let previous_exit_subst = !exit_subst in
exit_subst := new_subst @ !exit_subst;
let (new_body, sub_body) = rename body sub in
let res = List.map2 (fun (_, handler) (_, new_subst) -> rename handler !new_subst)
let res =
List.map2 (fun (_, handler) (_, new_subst) -> rename handler !new_subst)
handlers new_subst in
exit_subst := previous_exit_subst;
let merged_subst =
Expand Down
2 changes: 1 addition & 1 deletion asmrun/amd64nt.asm
Expand Up @@ -498,7 +498,7 @@ caml_ml_array_bound_error:
lea rax, caml_array_bound_error
jmp caml_c_call

PUBLIC caml_system__code_end
PUBLIC caml_system__code_end
caml_system__code_end:

.DATA
Expand Down
3 changes: 2 additions & 1 deletion bytecomp/bytegen.ml
Expand Up @@ -554,7 +554,8 @@ let rec comp_expr env exp sz cont =
(add_pop ndecl cont)))
end else begin
let decl_size =
List.map (fun (id, exp) -> (id, exp, size_of_lambda Ident.empty exp)) decl in
List.map (fun (id, exp) -> (id, exp, size_of_lambda Ident.empty exp))
decl in
let rec comp_init new_env sz = function
| [] -> comp_nonrec new_env sz ndecl decl_size
| (id, _exp, RHS_floatblock blocksize) :: rem ->
Expand Down
3 changes: 2 additions & 1 deletion bytecomp/bytegen.mli
Expand Up @@ -22,4 +22,5 @@ val compile_implementation: string -> lambda -> instruction list
val compile_phrase: lambda -> instruction list * instruction list
val reset: unit -> unit

val merge_events : Instruct.debug_event -> Instruct.debug_event -> Instruct.debug_event
val merge_events:
Instruct.debug_event -> Instruct.debug_event -> Instruct.debug_event
3 changes: 2 additions & 1 deletion bytecomp/bytelink.ml
Expand Up @@ -619,7 +619,8 @@ let link ppf objfiles output_name =
let basename = Filename.chop_extension output_name in
let temps = ref [] in
let c_file =
if !Clflags.output_complete_object && not (Filename.check_suffix output_name ".c")
if !Clflags.output_complete_object
&& not (Filename.check_suffix output_name ".c")
then Filename.temp_file "camlobj" ".c"
else begin
let f = basename ^ ".c" in
Expand Down
9 changes: 6 additions & 3 deletions bytecomp/emitcode.ml
Expand Up @@ -39,12 +39,15 @@ let marshal_to_channel_with_possibly_32bit_compat ~filename ~kind outchan obj =


let report_error ppf (file, kind) =
Format.fprintf ppf "Generated %s %S cannot be used on a 32-bit platform" kind file
Format.fprintf ppf "Generated %s %S cannot be used on a 32-bit platform"
kind file
let () =
Location.register_error_of_exn
(function
| Error (Not_compatible_32 info) -> Some (Location.error_of_printer_file report_error info)
| _ -> None
| Error (Not_compatible_32 info) ->
Some (Location.error_of_printer_file report_error info)
| _ ->
None
)

(* Buffering of bytecode *)
Expand Down
8 changes: 5 additions & 3 deletions bytecomp/emitcode.mli
Expand Up @@ -27,8 +27,9 @@ val to_file: out_channel -> string -> string ->
required_globals: list of compilation units that must be
evaluated before this one
list of instructions to emit *)
val to_memory: instruction list -> instruction list ->
Misc.LongString.t * (reloc_info * int) list * debug_event list
val to_memory:
instruction list -> instruction list ->
Misc.LongString.t * (reloc_info * int) list * debug_event list
(* Arguments:
initialization code (terminated by STOP)
function code
Expand All @@ -46,4 +47,5 @@ val to_packed_file:

val reset: unit -> unit

val marshal_to_channel_with_possibly_32bit_compat : filename:string -> kind:string -> out_channel -> 'a -> unit
val marshal_to_channel_with_possibly_32bit_compat :
filename:string -> kind:string -> out_channel -> 'a -> unit
1 change: 0 additions & 1 deletion bytecomp/meta.mli
Expand Up @@ -29,4 +29,3 @@ external invoke_traced_function : Obj.t -> Obj.t -> Obj.t -> Obj.t
= "caml_invoke_traced_function"
external get_section_table : unit -> (string * Obj.t) list
= "caml_get_section_table"

3 changes: 2 additions & 1 deletion bytecomp/translcore.ml
Expand Up @@ -416,7 +416,8 @@ and transl_exp0 e =
| Texp_new (cl, {Location.loc=loc}, _) ->
Lapply{ap_should_be_tailcall=false;
ap_loc=loc;
ap_func=Lprim(Pfield 0, [transl_class_path ~loc e.exp_env cl], loc);
ap_func=
Lprim(Pfield 0, [transl_class_path ~loc e.exp_env cl], loc);
ap_args=[lambda_unit];
ap_inlined=Default_inline;
ap_specialised=Default_specialise}
Expand Down

0 comments on commit fc36b23

Please sign in to comment.