Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions driver/flambda_backend_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ let mk_internal_assembler f =
let mk_gc_timings f =
"-dgc-timings", Arg.Unit f, "Output information about time spent in the GC"

let mk_no_auto_include_otherlibs f =
"-no-auto-include-otherlibs", Arg.Unit f,
"Add only stdlib to the list of include directories (unless -nostdlib is \
specified). Do not add subdirectories of other libraries distributed with \
the compiler (such as unix, str, dynlink). Do not alert when \
they are missing."

module Flambda2 = Flambda_backend_flags.Flambda2

let mk_flambda2_result_types_functors_only f =
Expand Down Expand Up @@ -603,6 +610,7 @@ module type Flambda_backend_options = sig
val internal_assembler : unit -> unit

val gc_timings : unit -> unit
val no_auto_include_otherlibs : unit -> unit

val flambda2_debug : unit -> unit
val no_flambda2_debug : unit -> unit
Expand Down Expand Up @@ -708,6 +716,7 @@ struct
mk_internal_assembler F.internal_assembler;

mk_gc_timings F.gc_timings;
mk_no_auto_include_otherlibs F.no_auto_include_otherlibs;

mk_flambda2_debug F.flambda2_debug;
mk_no_flambda2_debug F.no_flambda2_debug;
Expand Down Expand Up @@ -867,6 +876,7 @@ module Flambda_backend_options_impl = struct
let internal_assembler = set' Flambda_backend_flags.internal_assembler

let gc_timings = set' Flambda_backend_flags.gc_timings
let no_auto_include_otherlibs = set' Clflags.no_auto_include_otherlibs

let flambda2_debug = set' Flambda_backend_flags.Flambda2.debug
let no_flambda2_debug = clear' Flambda_backend_flags.Flambda2.debug
Expand Down Expand Up @@ -1088,6 +1098,7 @@ module Extra_params = struct
match name with
| "internal-assembler" -> set' Flambda_backend_flags.internal_assembler
| "dgc-timings" -> set' Flambda_backend_flags.gc_timings
| "no-auto-include-otherlibs" -> set' Clflags.no_auto_include_otherlibs
| "ocamlcfg" -> set' Flambda_backend_flags.use_ocamlcfg
| "cfg-invariants" -> set' Flambda_backend_flags.cfg_invariants
| "cfg-equivalence-check" -> set' Flambda_backend_flags.cfg_equivalence_check
Expand Down
1 change: 1 addition & 0 deletions driver/flambda_backend_args.mli
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module type Flambda_backend_options = sig
val internal_assembler : unit -> unit

val gc_timings : unit -> unit
val no_auto_include_otherlibs : unit -> unit

val flambda2_debug : unit -> unit
val no_flambda2_debug : unit -> unit
Expand Down
2 changes: 1 addition & 1 deletion ocaml/driver/compmisc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(**************************************************************************)

let auto_include find_in_dir fn =
if !Clflags.no_std_include then
if !Clflags.no_auto_include_otherlibs || !Clflags.no_std_include then
raise Not_found
else
let alert = Location.auto_include_alert in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/parsing/ast_mapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ module PpxContext = struct
(* Duplicates Compmisc.auto_include, since we can't reference Compmisc
from this module. *)
let auto_include find_in_dir fn =
if !Clflags.no_std_include then
if !Clflags.no_auto_include_otherlibs || !Clflags.no_std_include then
raise Not_found
else
let alert = Location.auto_include_alert in
Expand Down
2 changes: 2 additions & 0 deletions ocaml/utils/clflags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -673,3 +673,5 @@ end

let zero_alloc_check = ref Annotations.No_check (* -zero-alloc-check *)
let zero_alloc_check_assert_all = ref false (* -zero-alloc-check-assert-all *)

let no_auto_include_otherlibs = ref false (* -no-auto-include-otherlibs *)
1 change: 1 addition & 0 deletions ocaml/utils/clflags.mli
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,4 @@ end
val zero_alloc_check : Annotations.t ref
val zero_alloc_check_assert_all : bool ref

val no_auto_include_otherlibs : bool ref