aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorherbelin2010-07-18 11:29:23 +0000
committerherbelin2010-07-18 11:29:23 +0000
commite4a667a4503de1ebda52aee4aa5e08fb0711f1ce (patch)
treec4ff3db280f0dd3ac6c132b701fc6073a4f6323e /pretyping
parentadf6390ab7bf96b0ffd699e96bd6b27bd9d99d98 (diff)
Tentative de suppression de l'import automatique des hints et coercions.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13293 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/classops.ml27
1 files changed, 24 insertions, 3 deletions
diff --git a/pretyping/classops.ml b/pretyping/classops.ml
index 5c30f05aae..d57dd7b40d 100644
--- a/pretyping/classops.ml
+++ b/pretyping/classops.ml
@@ -336,7 +336,18 @@ let class_params = function
let add_class cl =
add_new_class cl { cl_param = class_params cl }
-let load_coercion i (_,(coe,stre,isid,cls,clt,ps)) =
+let automatically_import_coercions = ref false
+
+open Goptions
+let _ =
+ declare_bool_option
+ { optsync = true;
+ optname = "automatic importation of coercions";
+ optkey = ["Automatic";"Coercions";"Importation"];
+ optread = (fun () -> !automatically_import_coercions);
+ optwrite = (:=) automatically_import_coercions }
+
+let cache_coercion (_,(coe,stre,isid,cls,clt,ps)) =
add_class cls;
add_class clt;
let is,_ = class_info cls in
@@ -350,8 +361,17 @@ let load_coercion i (_,(coe,stre,isid,cls,clt,ps)) =
add_new_coercion coe xf;
add_coercion_in_graph (xf,is,it)
-let cache_coercion o =
- load_coercion 1 o
+let load_coercion _ o =
+ if
+ !automatically_import_coercions || Flags.version_less_or_equal Flags.V8_2
+ then
+ cache_coercion o
+
+let open_coercion _ o =
+ if not
+ (!automatically_import_coercions || Flags.version_less_or_equal Flags.V8_2)
+ then
+ cache_coercion o
let subst_coercion (subst,(coe,stre,isid,cls,clt,ps as obj)) =
let coe' = subst_coe_typ subst coe in
@@ -380,6 +400,7 @@ let classify_coercion (coe,stre,isid,cls,clt,ps as obj) =
let (inCoercion,_) =
declare_object {(default_object "COERCION") with
+ open_function = open_coercion;
load_function = load_coercion;
cache_function = cache_coercion;
subst_function = subst_coercion;