[m-rev.] diff: handle region_builtin in mdbcomp
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Jun 12 13:41:45 AEST 2007
Estimated hours taken: 0.5
Branches: main
Fix compiler handling of region_builtin module.
mdbcomp/prim_data.m:
Add a function mercury_region_builtin_module/1 that returns
the name of the builtin module that contains the RBMM primitives.
Extend other predicates related to builtin modules appropriately.
Delete a couple of comments that that indicated which compiler modules
some types used to be defined in before they were moved here.
Fix some formatting.
library/library.m:
Add a comment to the effect that changes to the list of builtin
modules may require changes to mdbcomp/prim_data.m.
Julien.
Index: library/library.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/library.m,v
retrieving revision 1.108
diff -u -r1.108 library.m
--- library/library.m 12 Jun 2007 03:22:24 -0000 1.108
+++ library/library.m 12 Jun 2007 03:39:30 -0000
@@ -142,6 +142,8 @@
:- import_module version_types.
% The modules intended for Mercury system implementors.
+% NOTE: changes to this list may need to be reflected in mdbcomp/prim_data.m.
+%
:- import_module erlang_rtti_implementation.
:- import_module mutvar.
:- import_module par_builtin.
Index: mdbcomp/prim_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/prim_data.m,v
retrieving revision 1.21
diff -u -r1.21 prim_data.m
--- mdbcomp/prim_data.m 2 May 2007 02:15:59 -0000 1.21
+++ mdbcomp/prim_data.m 12 Jun 2007 03:39:30 -0000
@@ -11,11 +11,10 @@
%
% This module contains some types and predicates that are, or are planned to
% be, shared between the compiler and the debugger.
-
+%
%-----------------------------------------------------------------------------%
:- module mdbcomp.prim_data.
-
:- interface.
:- import_module list.
@@ -23,6 +22,7 @@
% This enumeration must be EXACTLY the same as the MR_PredFunc enum
% in runtime/mercury_stack_layout.h, and in the same order, since the
% code (in browser) assumes the representation is the same.
+ %
:- type pred_or_func
---> pf_predicate
; pf_function.
@@ -34,6 +34,7 @@
% This enumeration must be EXACTLY the same as the MR_trace_port enum
% in runtime/mercury_trace_base.h, and in the same order, since the
% code (in browser) assumes the representation is the same.
+ %
:- type trace_port
---> port_call
; port_exit
@@ -53,18 +54,15 @@
; port_nondet_foreign_proc_later
; port_user.
-% was in compiler/prog_data.m
-
% The order that the sym_name function symbols appear in can be significant
% for module dependency ordering.
+ %
:- type sym_name
---> unqualified(string)
; qualified(sym_name, string).
:- type module_name == sym_name.
-% was in compiler/proc_label.m
-
% A proc_label is a data structure a backend can use to as the basis
% of the label used as the entry point of a procedure.
%
@@ -73,6 +71,7 @@
% When these are different, as for specialised versions of predicates
% from `.opt' files, the defining module's name may need to be added
% as a qualifier to the label.
+ %
:- type proc_label
---> ordinary_proc_label(
ord_defining_module :: module_name,
@@ -192,6 +191,12 @@
%
:- func mercury_private_builtin_module = sym_name.
+ % Returns the name of the module containing builtins for region-based
+ % memory management. This module is automatically imported iff
+ % RBMM is enabled.
+ %
+:- func mercury_region_builtin_module = sym_name.
+
% Returns the name of the module containing builtins for tabling;
% originally these were in "private_builtin", but were then moved into
% a separate module. This module is automatically imported iff any
@@ -233,6 +238,7 @@
:- pred non_traced_mercury_builtin_module(sym_name::in) is semidet.
%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
:- implementation.
@@ -241,6 +247,8 @@
:- import_module list.
:- import_module string.
+%-----------------------------------------------------------------------------%
+
string_to_sym_name_sep(String, ModuleSeparator) = Result :-
% This would be simpler if we had a string.rev_sub_string_search/3 pred.
% With that, we could search for underscores right-to-left, and construct
@@ -297,6 +305,7 @@
all_builtin_modules = [
mercury_public_builtin_module,
mercury_private_builtin_module,
+ mercury_region_builtin_module,
mercury_table_builtin_module,
mercury_profiling_builtin_module,
mercury_term_size_prof_builtin_module,
@@ -308,6 +317,7 @@
% qualified(unqualified("std"), "private_builtin"))).
mercury_public_builtin_module = unqualified("builtin").
mercury_private_builtin_module = unqualified("private_builtin").
+mercury_region_builtin_module = unqualified("region_builtin").
mercury_table_builtin_module = unqualified("table_builtin").
mercury_profiling_builtin_module = unqualified("profiling_builtin").
mercury_term_size_prof_builtin_module = unqualified("term_size_prof_builtin").
@@ -321,6 +331,7 @@
any_mercury_builtin_module(Module) :-
( Module = mercury_public_builtin_module
; Module = mercury_private_builtin_module
+ ; Module = mercury_region_builtin_module
; Module = mercury_table_builtin_module
; Module = mercury_profiling_builtin_module
; Module = mercury_term_size_prof_builtin_module
--------------------------------------------------------------------------
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