[m-rev.] diff: report stats with erlang backend

Peter Wang wangp at students.csse.unimelb.edu.au
Fri Jun 1 12:42:18 AEST 2007


Estimated hours taken: 0.1
Branches: main

compiler/mercury_compile.m:
	Report more fine-grained statistics when using the Erlang backend.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.438
diff -u -r1.438 mercury_compile.m
--- compiler/mercury_compile.m	1 Jun 2007 02:12:58 -0000	1.438
+++ compiler/mercury_compile.m	1 Jun 2007 02:39:54 -0000
@@ -5195,8 +5195,23 @@
     dump_info::in, dump_info::out, io::di, io::uo) is det.
 
 erlang_backend(HLDS, ELDS, !DumpInfo, !IO) :-
+    globals.io_lookup_bool_option(verbose, Verbose, !IO),
+    globals.io_lookup_bool_option(statistics, Stats, !IO),
+
+    maybe_write_string(Verbose, "% Converting HLDS to ELDS...\n", !IO),
     erl_code_gen(HLDS, ELDS0, !IO),
+    maybe_write_string(Verbose, "% done.\n", !IO),
+    maybe_report_stats(Stats, !IO),
+
+    maybe_write_string(Verbose, "% Generating RTTI data...\n", !IO),
+    elds_gen_rtti_data(HLDS, ELDS0, ELDS, !IO),
+    maybe_write_string(Verbose, "% done.\n", !IO),
+    maybe_report_stats(Stats, !IO).
+
+:- pred elds_gen_rtti_data(module_info::in, elds::in, elds::out,
+    io::di, io::uo) is det.
 
+elds_gen_rtti_data(HLDS, ELDS0, ELDS, !IO) :-
     % Generate the representations for various data structures
     % used for type classes.
     type_ctor_info.generate_rtti(HLDS, TypeCtorRttiData),
@@ -5210,7 +5225,6 @@
     ErlangRttiDatas = list.map(erlang_rtti_data(HLDS), RttiDatas),
 
     ELDS0 = elds(ModuleName, ForeignBodies, Defns, FEDefns, RttiDefns0),
-    
     rtti_data_list_to_elds(HLDS, ErlangRttiDatas, RttiDefns),
     ELDS = elds(ModuleName, ForeignBodies, Defns, FEDefns,
         RttiDefns0 ++ RttiDefns).
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list