[m-rev.] Change --dump-mlds to use the pretty printer
Ralph Becket
rafe at cs.mu.OZ.AU
Tue Oct 30 15:35:49 AEDT 2001
Estimated hours taken: 2
Branches: main
Changed --dump-mlds option to use the pretty printer now that the performance
bug in pprint has been solved. Compiling the current largest file in the
compiler directory, make_hlds.m at over 8000 lines, with `--dump-mlds all' now
takes about an hour of wall time on a fast machine and generates six MLDS dump
files each approximately 1M lines long. Doing the same for mercury_compile.m,
about half the size, takes only a minute.
compiler/mercury_compile.m:
Changed the --dump-mlds option to use the pretty printer
rather than io__print//1.
Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.220
diff -u -r1.220 mercury_compile.m
--- mercury_compile.m 2 Oct 2001 07:09:43 -0000 1.220
+++ mercury_compile.m 23 Oct 2001 08:18:56 -0000
@@ -33,6 +33,7 @@
:- import_module equiv_type, make_hlds, typecheck, purity, polymorphism, modes.
:- import_module switch_detection, cse_detection, det_analysis, unique_modes.
:- import_module stratify, simplify.
+:- import_module pprint.
% high-level HLDS transformations
:- import_module check_typeclass, intermod, trans_opt, table_gen, (lambda).
@@ -3957,10 +3958,8 @@
maybe_flush_output(Verbose),
io__tell(DumpFile, Res),
( { Res = ok } ->
- % XXX the following doesn't work, due to performance bugs
- % in pprint:
- % pprint__write(80, pprint__to_doc(MLDS)),
- io__print(MLDS), io__nl,
+ pprint__write(80, pprint__to_doc(MLDS)),
+ io__nl,
io__told,
maybe_write_string(Verbose, " done.\n"),
maybe_report_stats(Stats)
--------------------------------------------------------------------------
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