[m-rev.] diff: variable numbers in RTTI
Zoltan Somogyi
zs at cs.mu.OZ.AU
Wed Nov 24 16:22:47 AEDT 2004
compiler/prog_rep.m:
compiler/stack_layout.m:
When creating a representation of a procedure body, take into account
the variable number mapping we use when creating references to
variables in the main part of the RTTI, so that the various parts of
the RTTI (the part used by the procedural debugger and the part used by
the declarative debugger) are in sync.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
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/prog_rep.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.27
diff -u -b -r1.27 prog_rep.m
--- compiler/prog_rep.m 19 Nov 2004 11:54:20 -0000 1.27
+++ compiler/prog_rep.m 24 Nov 2004 01:08:53 -0000
@@ -27,10 +27,22 @@
:- import_module mdbcomp.
:- import_module mdbcomp__program_representation.
-:- import_module list.
+:- import_module list, map, std_util.
-:- pred prog_rep__represent_proc(list(prog_var)::in, hlds_goal::in,
- instmap::in, vartypes::in, module_info::in, proc_rep::out) is det.
+% A var_num_map maps each variable that occurs in any of a procedure's layout
+% structures to a number that uniquely identifies that variable, and to its
+% name.
+%
+% The integer returned by term__var_to_int are a dense set when we consider
+% all the original variables of a procedure. However, it can become less dense
+% when an optimization removes all references to a variable, and becomes less
+% dense still when we consider only variables that occur in a layout structure.
+% This is why we allocate our own id numbers.
+
+:- type var_num_map == map(prog_var, pair(int, string)).
+
+:- func prog_rep__represent_proc(list(prog_var), hlds_goal,
+ instmap, vartypes, var_num_map, module_info) = proc_rep.
:- implementation.
@@ -43,14 +55,15 @@
:- type prog_rep__info
---> info(
vartypes :: vartypes,
+ var_num_map :: var_num_map,
module_info :: module_info
).
-prog_rep__represent_proc(HeadVars, Goal, InstMap0, VarTypes, ModuleInfo,
- proc_rep(HeadVarsRep, GoalRep)) :-
+prog_rep__represent_proc(HeadVars, Goal, InstMap0, VarTypes, VarNumMap,
+ ModuleInfo) = proc_rep(HeadVarsRep, GoalRep) :-
list__map(term__var_to_int, HeadVars, HeadVarsRep),
- prog_rep__represent_goal(Goal, InstMap0, info(VarTypes, ModuleInfo),
- GoalRep).
+ prog_rep__represent_goal(Goal, InstMap0,
+ info(VarTypes, VarNumMap, ModuleInfo), GoalRep).
:- pred prog_rep__represent_goal(hlds_goal::in, instmap::in,
prog_rep__info::in, goal_rep::out) is det.
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.96
diff -u -b -r1.96 stack_layout.m
--- compiler/stack_layout.m 19 Nov 2004 05:46:09 -0000 1.96
+++ compiler/stack_layout.m 19 Nov 2004 05:47:11 -0000
@@ -568,8 +568,8 @@
MaybeProcRepRval = no
;
MaybeGoal = yes(Goal),
- prog_rep__represent_proc(HeadVars, Goal, InstMap, VarTypes,
- ModuleInfo, ProcRep),
+ ProcRep = prog_rep__represent_proc(HeadVars, Goal, InstMap,
+ VarTypes, VarNumMap, ModuleInfo),
type_to_univ(ProcRep, ProcRepUniv),
StaticCellInfo0 = !.Info ^ static_cell_info,
static_term__term_to_rval(ProcRepUniv, ProcRepRval,
@@ -680,18 +680,6 @@
!MaxNum, OffsetsTail, !Info).
%---------------------------------------------------------------------------%
-
-% A var_num_map maps each variable that occurs in any of a procedure's layout
-% structures to a number that uniquely identifies that variable, and to its
-% name.
-%
-% The integer returned by term__var_to_int are a dense set when we consider
-% all the original variables of a procedure. However, it can become less dense
-% when an optimization removes all references to a variable, and becomes less
-% dense still when we consider only variables that occur in a layout structure.
-% This is why we allocate our own id numbers.
-
-:- type var_num_map == map(prog_var, pair(int, string)).
:- pred compute_var_number_map(list(prog_var)::in, prog_varset::in,
assoc_list(int, internal_layout_info)::in, maybe(hlds_goal)::in,
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/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
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/gears
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/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
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 java/runtime
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
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/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
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/mmc_make
cvs diff: Diffing tests/mmc_make/lib
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
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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