[m-rev.] diff: dumping insts
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue May 13 18:01:56 AEST 2003
compiler/hlds_out.m:
Write out detailed insts and modes only if the hlds dump option
string includes 'D'; reinterpret the old 'i' flag to mean printing
out the variables in instmap deltas, as opposed to the full instmap
deltas themselves. The rationale is that the full delta can be
very big, and can clutter up the HLDS dump.
Convert one case of a predicate from leaving indented lines
in the output between code sections to leaving as yet empty lines
there, for clarity and to avoid a bug that sometimes caused indents
to be written twice in a row.
compiler/handle_options.m:
Add the D flag to the default expansion of -Dall and -DALL, to preserve
previous behavior of HLDS dumps.
Add -Dmost, which doesn't print inst details, the type and mode
tables, or clauses.
doc/user_guide.texi:
Update the documentation of dump option strings.
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/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.184
diff -u -b -r1.184 handle_options.m
--- compiler/handle_options.m 10 May 2003 05:03:51 -0000 1.184
+++ compiler/handle_options.m 13 May 2003 04:49:42 -0000
@@ -1793,8 +1793,9 @@
:- pred convert_dump_alias(string, string).
:- mode convert_dump_alias(in, out) is semidet.
-convert_dump_alias("ALL", "abcdfgilmnprstuvCIMPTU").
+convert_dump_alias("ALL", "abcdfgilmnprstuvCDIMPTU").
convert_dump_alias("all", "abcdfgilmnprstuvCMPT").
+convert_dump_alias("most", "bcdfgilmnprstuvP").
convert_dump_alias("codegen", "dfnprsu").
convert_dump_alias("vanessa", "ltuCIU").
convert_dump_alias("paths", "cP").
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.306
diff -u -b -r1.306 hlds_out.m
--- compiler/hlds_out.m 10 May 2003 05:03:51 -0000 1.306
+++ compiler/hlds_out.m 13 May 2003 04:57:44 -0000
@@ -1331,10 +1331,17 @@
[]
;
hlds_out__write_indent(Indent),
+ ( { string__contains_char(Verbose, 'D') } ->
io__write_string("% new insts: "),
- hlds_out__write_instmap_delta(InstMapDelta, VarSet,
- AppendVarnums, Indent),
+ hlds_out__write_instmap_delta(InstMapDelta,
+ VarSet, AppendVarnums, Indent),
io__write_string("\n")
+ ;
+ io__write_string("% vars with new insts: "),
+ hlds_out__write_instmap_delta_vars(
+ InstMapDelta, VarSet, AppendVarnums),
+ io__write_string("\n")
+ )
)
;
[]
@@ -1548,29 +1555,30 @@
(
{ GenericCall = higher_order(PredVar, Purity, PredOrFunc, _) },
globals__io_lookup_string_option(dump_hlds_options, Verbose),
- hlds_out__write_indent(Indent),
(
{ PredOrFunc = predicate },
( { string__contains_char(Verbose, 'l') } ->
- io__write_string("% higher-order predicate call\n"),
- hlds_out__write_indent(Indent)
+ hlds_out__write_indent(Indent),
+ io__write_string("% higher-order predicate call\n")
;
[]
),
+ hlds_out__write_indent(Indent),
write_purity_prefix(Purity),
hlds_out__write_functor(term__atom("call"),
- [PredVar|ArgVars], VarSet, AppendVarnums)
+ [PredVar | ArgVars], VarSet, AppendVarnums)
;
{ PredOrFunc = function },
( { string__contains_char(Verbose, 'l') } ->
+ hlds_out__write_indent(Indent),
io__write_string(
- "% higher-order function application\n"),
- hlds_out__write_indent(Indent)
+ "% higher-order function application\n")
;
[]
),
{ pred_args_to_func_args([PredVar | ArgVars],
FuncArgVars, FuncRetVar) },
+ hlds_out__write_indent(Indent),
write_purity_prefix(Purity),
mercury_output_var(FuncRetVar, VarSet, AppendVarnums),
io__write_string(" = "),
@@ -1582,10 +1590,9 @@
{ GenericCall = class_method(TCInfoVar, MethodNum,
_ClassId, _MethodId) },
globals__io_lookup_string_option(dump_hlds_options, Verbose),
- hlds_out__write_indent(Indent),
( { string__contains_char(Verbose, 'l') } ->
- io__write_string("% class method call\n"),
- hlds_out__write_indent(Indent)
+ hlds_out__write_indent(Indent),
+ io__write_string("% class method call\n")
;
[]
),
@@ -1597,25 +1604,24 @@
{ term__var_list_to_term_list(ArgVars, ArgTerms) },
{ Term = term__functor(Functor, [TCInfoTerm, MethodNumTerm | ArgTerms],
Context) },
+ hlds_out__write_indent(Indent),
mercury_output_term(Term, VarSet, AppendVarnums),
io__write_string(Follow)
;
{ GenericCall = unsafe_cast },
globals__io_lookup_string_option(dump_hlds_options, Verbose),
- hlds_out__write_indent(Indent),
( { string__contains_char(Verbose, 'l') } ->
- io__write_string("% unsafe_cast\n"),
- hlds_out__write_indent(Indent)
+ hlds_out__write_indent(Indent),
+ io__write_string("% unsafe_cast\n")
;
[]
),
- ( { string__contains_char(Verbose, 'i') } ->
+ ( { string__contains_char(Verbose, 'D') } ->
hlds_out__write_indent(Indent),
io__write_string("% modes: "),
{ varset__init(InstVarSet) },
mercury_output_mode_list(Modes, InstVarSet),
- io__nl,
- hlds_out__write_indent(Indent)
+ io__nl
;
[]
),
@@ -1623,10 +1629,12 @@
{ term__var_list_to_term_list(ArgVars, ArgTerms) },
{ term__context_init(Context) },
{ Term = term__functor(Functor, ArgTerms, Context) },
+ hlds_out__write_indent(Indent),
mercury_output_term(Term, VarSet, AppendVarnums),
io__write_string(Follow)
;
{ GenericCall = aditi_builtin(AditiBuiltin, CallId) },
+ hlds_out__write_indent(Indent),
hlds_out__write_aditi_builtin(ModuleInfo, AditiBuiltin, CallId,
ArgVars, VarSet, AppendVarnums, Indent, Follow)
).
@@ -2687,6 +2695,18 @@
{ instmap_delta_to_assoc_list(InstMapDelta, AssocList) },
hlds_out__write_instmap_2(AssocList, VarSet, AppendVarnums,
Indent)
+ ).
+
+:- pred hlds_out__write_instmap_delta_vars(instmap_delta::in, prog_varset::in,
+ bool::in, io__state::di, io__state::uo) is det.
+
+hlds_out__write_instmap_delta_vars(InstMapDelta, VarSet, AppendVarnums) -->
+ ( { instmap_delta_is_unreachable(InstMapDelta) } ->
+ io__write_string("unreachable")
+ ;
+ { instmap_delta_to_assoc_list(InstMapDelta, AssocList) },
+ { assoc_list__keys(AssocList, Vars) },
+ hlds_out__write_vars(Vars, VarSet, AppendVarnums)
).
hlds_out__write_import_status(local) -->
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.369
diff -u -b -r1.369 user_guide.texi
--- doc/user_guide.texi 11 May 2003 16:47:12 -0000 1.369
+++ doc/user_guide.texi 13 May 2003 04:49:25 -0000
@@ -4690,7 +4690,7 @@
d - determinism of goals,
f - follow_vars sets of goals,
g - goal feature lists,
-i - instmap deltas of goals,
+i - variables whose instantiation changes,
l - pred/mode ids and unify contexts of called predicates,
m - mode information about clauses,
n - nonlocal variables of goals,
@@ -4702,6 +4702,7 @@
v - variable numbers in variable names,
A - argument passing information,
C - clause information,
+D - instmap deltas of goals,
G - compile-time garbage collection information,
I - imported predicates,
M - mode and inst information,
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/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/lex/tests
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 java/library
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