aboutsummaryrefslogtreecommitdiff
path: root/kernel/safe_typing.ml
diff options
context:
space:
mode:
authorMaxime Dénès2019-05-27 13:20:32 +0200
committerMaxime Dénès2019-05-27 13:20:32 +0200
commit13034bc2a322d250a971c9cc73881a34f9d64025 (patch)
treee8f3046a5fb5faf034ff516de046fed3df91a671 /kernel/safe_typing.ml
parent1df3b08cb40bab6db1177b0289995d40287437f5 (diff)
parentd782dabc61251834e35a77c43e070ea8b4e0b04a (diff)
Merge PR #10198: Centralize the hashconsing of constant declarations.
Reviewed-by: maximedenes
Diffstat (limited to 'kernel/safe_typing.ml')
-rw-r--r--kernel/safe_typing.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index 873cc2a172..eb03854af4 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -555,6 +555,8 @@ let add_constant_aux ~in_section senv (kn, cb) =
end
| Undef _ | Def _ | Primitive _ | OpaqueDef _ -> []
in
+ (* This is the only place where we hashcons the contents of a constant body *)
+ let cb = if in_section then cb else Declareops.hcons_const_body cb in
let cb, otab = match cb.const_body with
| OpaqueDef lc when not in_section ->
(* In coqc, opaque constants outside sections will be stored
@@ -771,8 +773,7 @@ let export_private_constants ~in_section ce senv =
let add_recipe ~in_section l r senv =
let kn = Constant.make2 senv.modpath l in
- let cb = Term_typing.translate_recipe ~hcons:(not in_section) senv.env kn r in
- let cb = if in_section then cb else Declareops.hcons_const_body cb in
+ let cb = Term_typing.translate_recipe senv.env kn r in
let senv = add_constant_aux ~in_section senv (kn, cb) in
kn, senv