Avoid warning 58 in flambda ocamlnat
parent
cba5a765a2
commit
9e61a063c3
|
@ -360,7 +360,7 @@ let execute_phrase print_outcome ppf phr =
|
||||||
| Result _ ->
|
| Result _ ->
|
||||||
if Config.flambda then
|
if Config.flambda then
|
||||||
(* CR-someday trefis: *)
|
(* CR-someday trefis: *)
|
||||||
()
|
Env.register_import_as_opaque (Ident.name module_ident)
|
||||||
else
|
else
|
||||||
Compilenv.record_global_approx_toplevel ();
|
Compilenv.record_global_approx_toplevel ();
|
||||||
if print_outcome then
|
if print_outcome then
|
||||||
|
|
|
@ -790,6 +790,9 @@ let crc_of_unit name =
|
||||||
let is_imported_opaque modname =
|
let is_imported_opaque modname =
|
||||||
Persistent_env.is_imported_opaque persistent_env modname
|
Persistent_env.is_imported_opaque persistent_env modname
|
||||||
|
|
||||||
|
let register_import_as_opaque modname =
|
||||||
|
Persistent_env.register_import_as_opaque persistent_env modname
|
||||||
|
|
||||||
let reset_declaration_caches () =
|
let reset_declaration_caches () =
|
||||||
Types.Uid.Tbl.clear value_declarations;
|
Types.Uid.Tbl.clear value_declarations;
|
||||||
Types.Uid.Tbl.clear type_declarations;
|
Types.Uid.Tbl.clear type_declarations;
|
||||||
|
|
|
@ -370,9 +370,12 @@ val imports: unit -> crcs
|
||||||
(* may raise Persistent_env.Consistbl.Inconsistency *)
|
(* may raise Persistent_env.Consistbl.Inconsistency *)
|
||||||
val import_crcs: source:string -> crcs -> unit
|
val import_crcs: source:string -> crcs -> unit
|
||||||
|
|
||||||
(* [is_imported_opaque md] returns true if [md] is an opaque imported module *)
|
(* [is_imported_opaque md] returns true if [md] is an opaque imported module *)
|
||||||
val is_imported_opaque: modname -> bool
|
val is_imported_opaque: modname -> bool
|
||||||
|
|
||||||
|
(* [register_import_as_opaque md] registers [md] as an opaque imported module *)
|
||||||
|
val register_import_as_opaque: modname -> unit
|
||||||
|
|
||||||
(* Summaries -- compact representation of an environment, to be
|
(* Summaries -- compact representation of an environment, to be
|
||||||
exported in debugging information. *)
|
exported in debugging information. *)
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ let clear_missing {persistent_structures; _} =
|
||||||
let add_import {imported_units; _} s =
|
let add_import {imported_units; _} s =
|
||||||
imported_units := String.Set.add s !imported_units
|
imported_units := String.Set.add s !imported_units
|
||||||
|
|
||||||
let add_imported_opaque {imported_opaque_units; _} s =
|
let register_import_as_opaque {imported_opaque_units; _} s =
|
||||||
imported_opaque_units := String.Set.add s !imported_opaque_units
|
imported_opaque_units := String.Set.add s !imported_opaque_units
|
||||||
|
|
||||||
let find_in_cache {persistent_structures; _} s =
|
let find_in_cache {persistent_structures; _} s =
|
||||||
|
@ -164,7 +164,7 @@ let save_pers_struct penv crc ps pm =
|
||||||
| Rectypes -> ()
|
| Rectypes -> ()
|
||||||
| Alerts _ -> ()
|
| Alerts _ -> ()
|
||||||
| Unsafe_string -> ()
|
| Unsafe_string -> ()
|
||||||
| Opaque -> add_imported_opaque penv modname)
|
| Opaque -> register_import_as_opaque penv modname)
|
||||||
ps.ps_flags;
|
ps.ps_flags;
|
||||||
Consistbl.set crc_units modname crc ps.ps_filename;
|
Consistbl.set crc_units modname crc ps.ps_filename;
|
||||||
add_import penv modname
|
add_import penv modname
|
||||||
|
@ -190,7 +190,7 @@ let acknowledge_pers_struct penv check modname pers_sig pm =
|
||||||
if Config.safe_string then
|
if Config.safe_string then
|
||||||
error (Depend_on_unsafe_string_unit(ps.ps_name));
|
error (Depend_on_unsafe_string_unit(ps.ps_name));
|
||||||
| Alerts _ -> ()
|
| Alerts _ -> ()
|
||||||
| Opaque -> add_imported_opaque penv modname)
|
| Opaque -> register_import_as_opaque penv modname)
|
||||||
ps.ps_flags;
|
ps.ps_flags;
|
||||||
if check then check_consistency penv ps;
|
if check then check_consistency penv ps;
|
||||||
let {persistent_structures; _} = penv in
|
let {persistent_structures; _} = penv in
|
||||||
|
|
|
@ -77,6 +77,10 @@ val is_imported : 'a t -> modname -> bool
|
||||||
in [penv] as an opaque module *)
|
in [penv] as an opaque module *)
|
||||||
val is_imported_opaque : 'a t -> modname -> bool
|
val is_imported_opaque : 'a t -> modname -> bool
|
||||||
|
|
||||||
|
(* [register_import_as_opaque penv md] registers [md] in [penv] as an
|
||||||
|
opaque module *)
|
||||||
|
val register_import_as_opaque : 'a t -> modname -> unit
|
||||||
|
|
||||||
val make_cmi : 'a t -> modname -> Types.signature -> alerts
|
val make_cmi : 'a t -> modname -> Types.signature -> alerts
|
||||||
-> Cmi_format.cmi_infos
|
-> Cmi_format.cmi_infos
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue