[m-rev.] diff: rename erlang_type_ctor_rep functors

Peter Ross pro at missioncriticalit.com
Fri Jun 1 16:06:13 AEST 2007


Hi,


===================================================================


Estimated hours taken: 0.25
Branches: main

compiler/erl_rtti.m:
library/erlang_rtti_implementation.m:
	Place a prefix on each functor of
	erlang_type_ctor_rep.


Index: compiler/erl_rtti.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/erl_rtti.m,v
retrieving revision 1.6
diff -u -r1.6 erl_rtti.m
--- compiler/erl_rtti.m	1 Jun 2007 05:28:26 -0000	1.6
+++ compiler/erl_rtti.m	1 Jun 2007 06:04:43 -0000
@@ -590,61 +590,61 @@
 :- func erlang_type_ctor_rep(erlang_type_ctor_details) = elds_expr.
 
 erlang_type_ctor_rep(erlang_du(_)) =
-    elds_term(make_enum_alternative("du")).
+    elds_term(make_enum_alternative("etcr_du")).
 erlang_type_ctor_rep(erlang_list(_)) =
-    elds_term(make_enum_alternative("list")).
+    elds_term(make_enum_alternative("etcr_list")).
 erlang_type_ctor_rep(erlang_eqv(_)) =
-    elds_term(make_enum_alternative("eqv")).
+    elds_term(make_enum_alternative("etcr_eqv")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_int)) =
-    elds_term(make_enum_alternative("int")).
+    elds_term(make_enum_alternative("etcr_int")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_float)) =
-    elds_term(make_enum_alternative("float")).
+    elds_term(make_enum_alternative("etcr_float")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_char)) =
-    elds_term(make_enum_alternative("char")).
+    elds_term(make_enum_alternative("etcr_char")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_string)) =
-    elds_term(make_enum_alternative("string")).
+    elds_term(make_enum_alternative("etcr_string")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_void)) =
-    elds_term(make_enum_alternative("void")).
+    elds_term(make_enum_alternative("etcr_void")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_c_pointer(is_stable))) =
-    elds_term(make_enum_alternative("stable_c_pointer")).
+    elds_term(make_enum_alternative("etcr_stable_c_pointer")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_c_pointer(is_not_stable))) =
-    elds_term(make_enum_alternative("c_pointer")).
+    elds_term(make_enum_alternative("etcr_c_pointer")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_pred_ctor)) = 
-    elds_term(make_enum_alternative("pred")).
+    elds_term(make_enum_alternative("etcr_pred")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_func_ctor)) = 
-    elds_term(make_enum_alternative("func")).
+    elds_term(make_enum_alternative("etcr_func")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_tuple)) = 
-    elds_term(make_enum_alternative("tuple")).
+    elds_term(make_enum_alternative("etcr_tuple")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_ref)) = 
-    elds_term(make_enum_alternative("ref")).
+    elds_term(make_enum_alternative("etcr_ref")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_type_desc)) = 
-    elds_term(make_enum_alternative("type_desc")).
+    elds_term(make_enum_alternative("etcr_type_desc")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_pseudo_type_desc)) = 
-    elds_term(make_enum_alternative("pseudo_type_desc")).
+    elds_term(make_enum_alternative("etcr_pseudo_type_desc")).
 erlang_type_ctor_rep(erlang_builtin(builtin_ctor_type_ctor_desc)) = 
-    elds_term(make_enum_alternative("type_ctor_desc")).
+    elds_term(make_enum_alternative("etcr_type_ctor_desc")).
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_type_info)) =
-    elds_term(make_enum_alternative("type_info")).
+    elds_term(make_enum_alternative("etcr_type_info")).
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_type_ctor_info)) =
-    elds_term(make_enum_alternative("type_ctor_info")).
+    elds_term(make_enum_alternative("etcr_type_ctor_info")).
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_typeclass_info)) =
-    elds_term(make_enum_alternative("typeclass_info")).
+    elds_term(make_enum_alternative("etcr_typeclass_info")).
 erlang_type_ctor_rep(
     erlang_impl_artifact(erlang_impl_ctor_base_typeclass_info)) =
-    elds_term(make_enum_alternative("base_typeclass_info")).
+    elds_term(make_enum_alternative("etcr_base_typeclass_info")).
 erlang_type_ctor_rep(erlang_foreign) =
-    elds_term(make_enum_alternative("foreign")).
+    elds_term(make_enum_alternative("etcr_foreign")).
 
     %
     % These three types should never actually be used in
     % an Erlang program.
     %
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_hp)) =
-    elds_term(make_enum_alternative("hp")).
+    elds_term(make_enum_alternative("etcr_hp")).
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_subgoal)) =
-    elds_term(make_enum_alternative("subgoal")).
+    elds_term(make_enum_alternative("etcr_subgoal")).
 erlang_type_ctor_rep(erlang_impl_artifact(erlang_impl_ctor_ticket)) =
-    elds_term(make_enum_alternative("ticket")).
+    elds_term(make_enum_alternative("etcr_ticket")).
 
 :- pred gen_init_special_pred(module_info::in, maybe(rtti_proc_label)::in,
     elds_expr::out, prog_varset::in, prog_varset::out) is det.
Index: library/erlang_rtti_implementation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/erlang_rtti_implementation.m,v
retrieving revision 1.1
diff -u -r1.1 erlang_rtti_implementation.m
--- library/erlang_rtti_implementation.m	1 Jun 2007 02:13:02 -0000	1.1
+++ library/erlang_rtti_implementation.m	1 Jun 2007 06:04:43 -0000
@@ -62,35 +62,35 @@
     % given by the function erl_rtti.erlang_type_ctor_rep/1
     %
 :- type erlang_type_ctor_rep
-    --->    du
-    ;       list
-    ;       eqv
-    ;       int
-    ;       float
-    ;       char
-    ;       string
-    ;       void
-    ;       stable_c_pointer
-    ;       c_pointer
-    ;       (pred)
-    ;       (func)
-    ;       tuple
-    ;       ref
-    ;       type_desc
-    ;       pseudo_type_desc
-    ;       type_ctor_desc
-    ;       type_info
-    ;       type_ctor_info
-    ;       typeclass_info
-    ;       base_typeclass_info
-    ;       foreign
+    --->    etcr_du
+    ;       etcr_list
+    ;       etcr_eqv
+    ;       etcr_int
+    ;       etcr_float
+    ;       etcr_char
+    ;       etcr_string
+    ;       etcr_void
+    ;       etcr_stable_c_pointer
+    ;       etcr_c_pointer
+    ;       etcr_pred
+    ;       etcr_func
+    ;       etcr_tuple
+    ;       etcr_ref
+    ;       etcr_type_desc
+    ;       etcr_pseudo_type_desc
+    ;       etcr_type_ctor_desc
+    ;       etcr_type_info
+    ;       etcr_type_ctor_info
+    ;       etcr_typeclass_info
+    ;       etcr_base_typeclass_info
+    ;       etcr_foreign
 
             % These types shouldn't be needed they are
             % introduced for library predicates which
             % don't apply on this backend.
-    ;       hp
-    ;       subgoal
-    ;       ticket
+    ;       etcr_hp
+    ;       etcr_subgoal
+    ;       etcr_ticket
     .
 
 %-----------------------------------------------------------------------------%
@@ -101,11 +101,11 @@
     TypeCtorInfo = TypeInfo ^ type_ctor_info,
     TypeCtorRep = TypeCtorInfo ^ type_ctor_rep,
     (
-        TypeCtorRep = tuple
+        TypeCtorRep = etcr_tuple
     ->
         unify_tuple(TypeInfo, X, Y)
     ;
-        ( TypeCtorRep = (pred) ; TypeCtorRep = (func) )
+        ( TypeCtorRep = etcr_pred ; TypeCtorRep = etcr_func )
     ->
         error("unify/2: higher order unification not possible")
     ;
@@ -178,11 +178,11 @@
     TypeCtorInfo = TypeInfo ^ type_ctor_info,
     TypeCtorRep = TypeCtorInfo ^ type_ctor_rep,
     (
-        TypeCtorRep = tuple
+        TypeCtorRep = etcr_tuple
     ->
         compare_tuple(TypeInfo, Res, X, Y)
     ;
-        ( TypeCtorRep = (pred) ; TypeCtorRep = (func) )
+        ( TypeCtorRep = etcr_pred ; TypeCtorRep = etcr_func )
     ->
         error("compare/3: higher order comparison not possible")
     ;

--------------------------------------------------------------------------
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