[m-rev.] diff: name special preds with mode number (erlang)

Peter Wang wangp at students.csse.unimelb.edu.au
Mon Jun 18 14:42:23 AEST 2007


Estimated hours taken: 0.2
Branches: main

compiler/elds_to_erlang.m:
	Attach mode numbers when naming special procedures in the Erlang
	backend.

library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
	Add mode number suffixes to hand written special procedures.


Index: compiler/elds_to_erlang.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/elds_to_erlang.m,v
retrieving revision 1.18
diff -u -r1.18 elds_to_erlang.m
--- compiler/elds_to_erlang.m	14 Jun 2007 04:43:50 -0000	1.18
+++ compiler/elds_to_erlang.m	18 Jun 2007 04:38:17 -0000
@@ -922,8 +922,9 @@
                 MaybeExtModule = no
             )
         ),
+        proc_id_to_int(ProcId, ModeNum),
         ProcNameStr = ProcNameStr1 ++ TypeName ++ "_" ++
-            string.from_int(TypeArity)
+            string.from_int(TypeArity) ++ "_" ++ string.from_int(ModeNum)
     ;
         unexpected(this_file,
             "erlang_special_proc_name: cannot make label for special pred " ++
Index: library/builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.129
diff -u -r1.129 builtin.m
--- library/builtin.m	1 Jun 2007 02:13:01 -0000	1.129
+++ library/builtin.m	18 Jun 2007 04:38:17 -0000
@@ -805,10 +805,10 @@
 
 :- pragma foreign_code("Erlang", "
 
-    '__Compare____c_pointer_0'(_, _) ->
+    '__Compare____c_pointer_0_0'(_, _) ->
         throw(""called compare/3 for type `c_pointer'"").
 
-    '__Unify____c_pointer_0'(_, _) ->
+    '__Unify____c_pointer_0_0'(_, _) ->
         throw(""called unify for type `c_pointer'"").
 
     compare_3_p_0(TypeInfo, X, Y) ->
@@ -832,22 +832,22 @@
         mercury__erlang_rtti_implementation:generic_unify_2_p_0(
             TypeInfo, X, Y).
 
-    '__Unify____tuple_0'(X, Y) ->
+    '__Unify____tuple_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to unify for tuple/0"").
 
-    '__Compare____tuple_0'(X, Y) ->
+    '__Compare____tuple_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to compare for tuple/0"").
 
-    '__Unify____void_0'(X, Y) ->
+    '__Unify____void_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to unify for void/0"").
 
-    '__Compare____void_0'(X, Y) ->
+    '__Compare____void_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to compare for void/0"").
 
-    '__Unify____func_0'(X, Y) ->
+    '__Unify____func_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to unify for func/0"").
 
-    '__Compare____func_0'(X, Y) ->
+    '__Compare____func_0_0'(X, Y) ->
         mercury__require:error_1_p_0(""call to compare for func/0"").
 
 ").
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.169
diff -u -r1.169 private_builtin.m
--- library/private_builtin.m	6 Jun 2007 08:23:08 -0000	1.169
+++ library/private_builtin.m	18 Jun 2007 04:38:17 -0000
@@ -567,28 +567,28 @@
 
 :- pragma foreign_code("Erlang", "
 
-'__Unify____type_info_0'(X, Y) ->
+'__Unify____type_info_0_0'(X, Y) ->
     throw(""unify for type_info"").
 
-'__Unify____typeclass_info_0'(X, Y) ->
+'__Unify____typeclass_info_0_0'(X, Y) ->
     throw(""unify for typeclass_info"").
 
-'__Unify____base_typeclass_info_0'(X, Y) ->
+'__Unify____base_typeclass_info_0_0'(X, Y) ->
     throw(""unify for base_typeclass_info"").
 
-'__Unify____type_ctor_info_0'(X, Y) ->
+'__Unify____type_ctor_info_0_0'(X, Y) ->
     throw(""unify for type_ctor_info"").
 
-'__Compare____type_ctor_info_0'(X, Y) ->
+'__Compare____type_ctor_info_0_0'(X, Y) ->
     throw(""compare for type_ctor_info"").
 
-'__Compare____type_info_0'(X, Y) ->
+'__Compare____type_info_0_0'(X, Y) ->
     throw(""compare for type_info"").
 
-'__Compare____typeclass_info_0'(X, Y) ->
+'__Compare____typeclass_info_0_0'(X, Y) ->
     throw(""compare for typeclass_info"").
 
-'__Compare____base_typeclass_info_0'(X, Y) ->
+'__Compare____base_typeclass_info_0_0'(X, Y) ->
     throw(""compare for base_typeclass_info"").
 ").
 
@@ -1730,16 +1730,16 @@
 ").
 
 :- pragma foreign_code("Erlang", "
-    '__Compare____heap_pointer_0'(_, _) ->
+    '__Compare____heap_pointer_0_0'(_, _) ->
         throw(""called compare/2 for type `private_builtin.heap_pointer'"").
         
-    '__Unify____heap_pointer_0'(_, _) ->
+    '__Unify____heap_pointer_0_0'(_, _) ->
         throw(""called unify/2 for type `private_builtin.heap_pointer'"").
 
-    '__Compare____ref_1'(_, _, _) ->
+    '__Compare____ref_1_0'(_, _, _) ->
         throw(""called compare/3 for type `private_builtin.ref'"").
 
-    '__Unify____ref_1'(TypeInfo, X, Y) ->
+    '__Unify____ref_1_0'(TypeInfo, X, Y) ->
         case X =:= Y of
             true -> {};
             false -> fail
Index: library/type_desc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/type_desc.m,v
retrieving revision 1.48
diff -u -r1.48 type_desc.m
--- library/type_desc.m	12 Jun 2007 01:55:40 -0000	1.48
+++ library/type_desc.m	18 Jun 2007 04:38:17 -0000
@@ -882,39 +882,39 @@
 ").
 
 :- pragma foreign_code("Erlang", "
-    '__Unify____type_desc_0'(X, Y) ->
+    '__Unify____type_desc_0_0'(X, Y) ->
         case X =:= Y of
             true -> {};
             false -> fail
         end.
 
-    '__Unify____type_ctor_desc_0'(X, Y) ->
+    '__Unify____type_ctor_desc_0_0'(X, Y) ->
         case X =:= Y of
             true -> {};
             false -> fail
         end.
 
-    '__Unify____pseudo_type_desc_0'(X, Y) ->
+    '__Unify____pseudo_type_desc_0_0'(X, Y) ->
         case X =:= Y of
             true -> {};
             false -> fail
         end.
 
-    '__Compare____type_desc_0'(X, Y) ->
+    '__Compare____type_desc_0_0'(X, Y) ->
         if
             X =:= Y -> {{'='}};
             X  <  Y -> {{'<'}};
             true    -> {{'>'}}
         end.
 
-    '__Compare____type_ctor_desc_0'(X, Y) ->
+    '__Compare____type_ctor_desc_0_0'(X, Y) ->
         if
             X =:= Y -> {{'='}};
             X  <  Y -> {{'<'}};
             true    -> {{'>'}}
         end.
 
-    '__Compare____pseudo_type_desc_0'(X, Y) ->
+    '__Compare____pseudo_type_desc_0_0'(X, Y) ->
         if
             X =:= Y -> {{'='}};
             X  <  Y -> {{'<'}};
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list