[m-rev.] diff: mangling method pred names
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Jul 3 12:49:46 AEST 2001
DJ has already reviewed the substantive part of this change.
compiler/check_typeclass.m:
Change the scheme we use to form the name of the predicate we introduce
for typeclass methods to make it reversible, i.e. to allow a demangler
to use the predicate name to find out the names of the class, the
method, and the instance types *unambiguously*; The old scheme was
ambiguous.
Also change the prefix used by the scheme to something more relevant.
tests/debugger/*.exp:
Update the names of method predicates in the expected outputs of the
tests using typeclasses.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.42
diff -u -b -r1.42 check_typeclass.m
--- compiler/check_typeclass.m 2001/06/27 05:04:02 1.42
+++ compiler/check_typeclass.m 2001/07/01 15:24:49
@@ -812,7 +812,7 @@
InstanceString),
string__append_list(
[check_typeclass__introduced_pred_name_prefix,
- ClassNameString, "__",
+ ClassNameString, "____",
InstanceString, "____",
MethodNameString, "_",
ArityString],
@@ -823,7 +823,7 @@
% used to call a class method for a specific instance.
:- func check_typeclass__introduced_pred_name_prefix = string.
-check_typeclass__introduced_pred_name_prefix = "Introduced_pred_for_".
+check_typeclass__introduced_pred_name_prefix = "ClassMethod_for_".
%---------------------------------------------------------------------------%
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/existential_type_classes.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/existential_type_classes.exp,v
retrieving revision 1.9
diff -u -b -r1.9 existential_type_classes.exp
--- tests/debugger/existential_type_classes.exp 1999/11/20 13:06:10 1.9
+++ tests/debugger/existential_type_classes.exp 2001/07/01 21:01:47
@@ -20,7 +20,7 @@
HeadVar__1 42
mdb>
4: 4 4 CALL existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
mdb> P
HeadVar__1 42
mdb> continue -a
@@ -29,7 +29,7 @@
6: 5 5 EXIT existential_type_classes.m:44 (from existential_type_classes.m:21)
pred existential_type_classes:int_foo/2-0 (det)
7: 4 4 EXIT existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
8: 3 3 EXIT (from existential_type_classes.m:68)
pred existential_type_classes:foo/2-0 (det)
9: 2 2 EXIT existential_type_classes.m:68 (from existential_type_classes.m:51)
@@ -49,7 +49,7 @@
HeadVar__1 "blah"
mdb>
12: 8 4 CALL existential_type_classes.m:25
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__string__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____string__arity0______existential_type_classes__foo_2/2-0 (det)
mdb> P
HeadVar__1 "blah"
mdb> continue -a
@@ -58,7 +58,7 @@
14: 9 5 EXIT existential_type_classes.m:47 (from existential_type_classes.m:25)
pred existential_type_classes:string_foo/2-0 (det)
15: 8 4 EXIT existential_type_classes.m:25
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__string__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____string__arity0______existential_type_classes__foo_2/2-0 (det)
16: 7 3 EXIT (from existential_type_classes.m:68)
pred existential_type_classes:foo/2-0 (det)
17: 6 2 EXIT existential_type_classes.m:68 (from existential_type_classes.m:52)
@@ -82,7 +82,7 @@
HeadVar__1 43
mdb>
22: 13 4 CALL existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
mdb> P
HeadVar__1 43
mdb> continue -a
@@ -91,7 +91,7 @@
24: 14 5 EXIT existential_type_classes.m:44 (from existential_type_classes.m:21)
pred existential_type_classes:int_foo/2-0 (det)
25: 13 4 EXIT existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
26: 12 3 EXIT (from existential_type_classes.m:68)
pred existential_type_classes:foo/2-0 (det)
27: 11 2 EXIT existential_type_classes.m:68 (from existential_type_classes.m:53)
@@ -119,7 +119,7 @@
HeadVar__1 43
mdb>
34: 19 4 CALL existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
mdb> P
HeadVar__1 43
mdb> continue -a
@@ -128,7 +128,7 @@
36: 20 5 EXIT existential_type_classes.m:44 (from existential_type_classes.m:21)
pred existential_type_classes:int_foo/2-0 (det)
37: 19 4 EXIT existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
38: 18 3 EXIT (from existential_type_classes.m:68)
pred existential_type_classes:foo/2-0 (det)
39: 17 2 EXIT existential_type_classes.m:68 (from existential_type_classes.m:54)
@@ -156,7 +156,7 @@
HeadVar__1 45
mdb>
46: 25 4 CALL existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
mdb> P
HeadVar__1 45
mdb> continue -a
@@ -165,7 +165,7 @@
48: 26 5 EXIT existential_type_classes.m:44 (from existential_type_classes.m:21)
pred existential_type_classes:int_foo/2-0 (det)
49: 25 4 EXIT existential_type_classes.m:21
- pred existential_type_classes:Introduced_pred_for_existential_type_classes__fooable__int__arity0______existential_type_classes__foo_2/2-0 (det)
+ pred existential_type_classes:ClassMethod_for_existential_type_classes__fooable____int__arity0______existential_type_classes__foo_2/2-0 (det)
50: 24 3 EXIT (from existential_type_classes.m:68)
pred existential_type_classes:foo/2-0 (det)
51: 23 2 EXIT existential_type_classes.m:68 (from existential_type_classes.m:55)
Index: tests/debugger/implied_instance.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/implied_instance.exp,v
retrieving revision 1.7
diff -u -b -r1.7 implied_instance.exp
--- tests/debugger/implied_instance.exp 1999/11/20 01:03:25 1.7
+++ tests/debugger/implied_instance.exp 2001/07/01 21:01:52
@@ -11,7 +11,7 @@
mdb> P
HeadVar__1 2
mdb>
- 3: 3 3 CALL pred implied_instance:Introduced_pred_for_implied_instance__sumable__int__arity0______implied_instance__p_2/2-0 (det)
+ 3: 3 3 CALL pred implied_instance:ClassMethod_for_implied_instance__sumable____int__arity0______implied_instance__p_2/2-0 (det)
mdb> P
HeadVar__1 2
mdb> break -e p
@@ -19,13 +19,13 @@
mdb> continue -a
4: 4 4 CALL pred implied_instance:copy_int/2-0 (det)
5: 4 4 EXIT pred implied_instance:copy_int/2-0 (det)
- 6: 3 3 EXIT pred implied_instance:Introduced_pred_for_implied_instance__sumable__int__arity0______implied_instance__p_2/2-0 (det)
+ 6: 3 3 EXIT pred implied_instance:ClassMethod_for_implied_instance__sumable____int__arity0______implied_instance__p_2/2-0 (det)
7: 2 2 EXIT pred implied_instance:p/2-0 (det)
8: 5 2 CALL pred implied_instance:p/2-0 (det)
mdb> P
HeadVar__1 [42, 24, 1, 2, 3]
mdb>
- 9: 6 3 CALL pred implied_instance:Introduced_pred_for_implied_instance__sumable__list__list__arity1______implied_instance__p_2/2-0 (det)
+ 9: 6 3 CALL pred implied_instance:ClassMethod_for_implied_instance__sumable____list__list__arity1______implied_instance__p_2/2-0 (det)
mdb> P
HeadVar__1 [42, 24, 1, 2, 3]
mdb>
@@ -38,7 +38,7 @@
mdb> P
HeadVar__1 42
mdb>
- 13: 9 6 CALL pred implied_instance:Introduced_pred_for_implied_instance__sumable__int__arity0______implied_instance__p_2/2-0 (det)
+ 13: 9 6 CALL pred implied_instance:ClassMethod_for_implied_instance__sumable____int__arity0______implied_instance__p_2/2-0 (det)
mdb> P
HeadVar__1 42
mdb> continue -S
Index: tests/debugger/multi_parameter.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/multi_parameter.exp,v
retrieving revision 1.9
diff -u -b -r1.9 multi_parameter.exp
--- tests/debugger/multi_parameter.exp 1999/12/13 07:43:40 1.9
+++ tests/debugger/multi_parameter.exp 2001/07/01 21:02:01
@@ -14,12 +14,12 @@
mdb> print *
HeadVar__1 'z'
mdb>
- 4: 4 4 CALL pred multi_parameter:Introduced_pred_for_multi_parameter__m__character__arity0__int__arity0______multi_parameter__a_2/2-0 (det)
+ 4: 4 4 CALL pred multi_parameter:ClassMethod_for_multi_parameter__m____character__arity0__int__arity0______multi_parameter__a_2/2-0 (det)
multi_parameter.m:20
mdb> print *
HeadVar__1 'z'
mdb>
- 5: 4 4 EXIT pred multi_parameter:Introduced_pred_for_multi_parameter__m__character__arity0__int__arity0______multi_parameter__a_2/2-0 (det)
+ 5: 4 4 EXIT pred multi_parameter:ClassMethod_for_multi_parameter__m____character__arity0__int__arity0______multi_parameter__a_2/2-0 (det)
multi_parameter.m:20
mdb> print *
HeadVar__1 'z'
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list