aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/nativevalues.ml
diff options
context:
space:
mode:
authorGravatar mdenes <mdenes@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-03-25 14:41:06 +0000
committerGravatar mdenes <mdenes@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-03-25 14:41:06 +0000
commit86357b63200368c818bbade20f2d71a3ddbaacb5 (patch)
tree218c29d4d2ae39a5ea33a1c876abdf041be79e05 /kernel/nativevalues.ml
parentb37bb277285db6b35ab4d147dddf3e45ae9707d3 (diff)
Native compiler: hash-consing of generated code and values.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16363 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/nativevalues.ml')
-rw-r--r--kernel/nativevalues.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/nativevalues.ml b/kernel/nativevalues.ml
index 2f317ca96..f03d4f799 100644
--- a/kernel/nativevalues.ml
+++ b/kernel/nativevalues.ml
@@ -8,6 +8,7 @@
open Term
open Names
open Errors
+open Util
(** This modules defines the representation of values internally used by
the native compiler *)
@@ -30,10 +31,22 @@ type annot_sw = {
asw_prefix : string
}
+(* We compare only what is relevant for generation of ml code *)
+let eq_annot_sw asw1 asw2 =
+ eq_ind asw1.asw_ind asw2.asw_ind &&
+ String.equal asw1.asw_prefix asw2.asw_prefix
+
+open Hashset.Combine
+
+let hash_annot_sw asw =
+ combine (Hashtbl.hash asw.asw_ind) (Hashtbl.hash asw.asw_prefix)
+
type sort_annot = string * int
type rec_pos = int array
+let eq_rec_pos = Array.equal Int.equal
+
type atom =
| Arel of int
| Aconstant of constant