[m-rev.] for review: add a demangled name field to MR_ProcIds

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Dec 31 16:19:59 AEDT 2001


For review by Fergus.

To allow us to fill in this field properly, I propose the following:

- That we replace the name fields of pred_infos (which is currently a string)
  with a structured data type with three base functors for user-defined
  preds/funcs and compiler-generated unify/index/compare preds and
  compiler-generated lambda preds/funcs respectively, and some recursive
  functors that tack on things such as type specialization, higher-order
  specialization, unused arg removal etc.

- That this type be defined in a new module, together with the code for
  turning values of that type into a string and for parsing the resulting
  strings back to values of that type.

- That this module be in the library (probably with documentation suppressed
  as we currently do for e.g. private_builtin), so that we can replace all
  mangling/demangling code with calls to the code of this library module.
  This should not just the compiler, the old profiler and the deep profiler,
  but even include util/mdemangle.c, if we can solve the bootstrapping issue
  involved.

Comments, anyone?

Zoltan.

Add an extra field to MR_Proc_Id structures, which are part of closures
and of the data structures we use for debugging. This field is intended
to contain the demangled name of the procedure for human consumption.
For now, the field is filled in with a placeholder, which is OK because
as yet no code looks at it.

runtime/mercury_stack_layout.h
	Add the new field to the variants of the MR_Proc_Id structure and
	to the macros that fill in that structure.

compiler/layout_out.m:
	Fill in the new field.

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/layout_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.5
diff -u -b -r1.5 layout_out.m
--- compiler/layout_out.m	2001/07/03 08:16:05	1.5
+++ compiler/layout_out.m	2001/12/30 09:45:51
@@ -755,6 +755,9 @@
 		io__write_int(Arity),
 		io__write_string(",\n\t"),
 		io__write_int(ModeInt),
+		io__write_string(",\n\t"),
+		% The demangled name is just a placeholder for now.
+		quote_and_write_string(Name),
 		io__write_string("\n")
 	;
 		{ ProcLabel = special_proc(DefiningModule, PredName,
@@ -775,6 +778,9 @@
 		io__write_int(TypeArity),
 		io__write_string(",\n\t"),
 		io__write_int(ModeInt),
+		io__write_string(",\n\t"),
+		% The demangled name is just a placeholder for now.
+		quote_and_write_string(TypeName),
 		io__write_string("\n")
 	).
 
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
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.53
diff -u -b -r1.53 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	2001/12/10 06:50:11	1.53
+++ runtime/mercury_stack_layout.h	2001/12/30 13:50:09
@@ -463,6 +463,7 @@
 	MR_ConstString		MR_user_name;
 	MR_int_least16_t	MR_user_arity;
 	MR_int_least16_t	MR_user_mode;
+	MR_ConstString		MR_user_demangled_name;
 } MR_User_Proc_Id;
 
 typedef struct MR_Compiler_Proc_Id_Struct {
@@ -472,6 +473,7 @@
 	MR_ConstString		MR_comp_pred_name;
 	MR_int_least16_t	MR_comp_arity;
 	MR_int_least16_t	MR_comp_mode;
+	MR_ConstString		MR_comp_demangled_name;
 } MR_Compiler_Proc_Id;
 
 typedef union MR_Proc_Id_Union {
@@ -767,7 +769,8 @@
 			module,						\
 			name,						\
 			arity,						\
-			mode						\
+			mode,						\
+			name						\
 		},							\
 		0							\
 	}
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
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