Skip to content

Commit

Permalink
Deprecate -vmthread
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedimino committed Sep 10, 2018
1 parent da5c22a commit 62f22d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -112,6 +112,9 @@ Working version
(Christopher Zimmermann, review by Xavier Leroy, Damien Doligez, David
Allsopp, David Sheets)

- GPR#2038: Deprecate vm threads
(Jérémie Dimino)

### Compiler user-interface and warnings:

- PR#6416, GPR#1120: unique printed names for identifiers
Expand Down
8 changes: 8 additions & 0 deletions driver/main.ml
Expand Up @@ -142,6 +142,12 @@ module Options = Main_args.Make_bytecomp_options (struct
let anonymous = anonymous
end)

let vmthread_deprecated_message = "\
The -vmthread argument of ocamlc is deprecated\n\
and will soon be abandoned. For VM-level scheduling, consider using a\n\
third-party library such as Lwt. Otherwise, please switch to system\n\
threads."

let main () =
Clflags.add_arguments __LOC__ Options.list;
Clflags.add_arguments __LOC__
Expand All @@ -151,6 +157,8 @@ let main () =
readenv ppf Before_args;
Clflags.parse_arguments anonymous usage;
Compmisc.read_color_env ();
if !Clflags.use_vmthreads then
Location.deprecated Location.none vmthread_deprecated_message;
begin try
Compenv.process_deferred_actions
(ppf,
Expand Down
4 changes: 2 additions & 2 deletions driver/main_args.ml
Expand Up @@ -553,8 +553,8 @@ let mk_no_version f =

let mk_vmthread f =
"-vmthread", Arg.Unit f,
" Generate code that supports the threads library with VM-level\n\
\ scheduling"
" (deprecated) Generate code that supports the threads library\n\
\ with VM-level scheduling"
;;

let mk_vnum f =
Expand Down

0 comments on commit 62f22d8

Please sign in to comment.