summaryrefslogtreecommitdiff
path: root/compiler/Translate.ml
diff options
context:
space:
mode:
authorSon Ho2023-09-16 22:50:19 +0200
committerSon Ho2023-09-16 22:50:19 +0200
commit515d95d786fed13c300b9e0d7619711ee6aaf971 (patch)
tree98d04b53e410b43f01b5840050401c0162662a52 /compiler/Translate.ml
parente6e749d47f05a6d48625c305b6af132440382efb (diff)
Add a strict_names_map in the extraction_ctx
Diffstat (limited to '')
-rw-r--r--compiler/Translate.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/Translate.ml b/compiler/Translate.ml
index 90066163..ebb0de0e 100644
--- a/compiler/Translate.ml
+++ b/compiler/Translate.ml
@@ -986,6 +986,19 @@ let translate_crate (filename : string) (dest_dir : string) (crate : A.crate) :
mk_formatter_and_names_map trans_ctx crate.name
variant_concatenate_type_name
in
+ let strict_names_map =
+ let open ExtractBase in
+ let ids =
+ List.filter
+ (fun (id, _) -> strict_collisions id)
+ (IdMap.bindings names_map.id_to_name)
+ in
+ let is_opaque = false in
+ List.fold_left
+ (* id_to_string: we shouldn't need to use it *)
+ (fun m (id, n) -> names_map_add show_id is_opaque id n m)
+ empty_names_map ids
+ in
(* We need to compute which functions are recursive, in order to know
* whether we should generate a decrease clause or not. *)
@@ -1041,6 +1054,7 @@ let translate_crate (filename : string) (dest_dir : string) (crate : A.crate) :
trans_ctx;
names_map;
unsafe_names_map = { id_to_name = ExtractBase.IdMap.empty };
+ strict_names_map;
fmt;
indent_incr = 2;
use_opaque_pre = !Config.split_files;