[m-dev.] for review: RTTI support for MLDS back-end
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Apr 19 13:59:51 AEST 2000
On 18-Apr-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
>
> Implement RTTI support for the MLDS back-end using the rtti module.
This one was not really affecting anything apart from the RTTI back-end,
so I went ahead and committed it.
I forgot to include a couple of files in the diff that I posted:
compiler/mode_util.m:
Add modes_to_arg_modes, which is like mode_to_arg_mode
except that its arguments are lists.
compiler/code_util.m:
Trivial change to handle the new fields of the rtti_proc_label type.
Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/mode_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_util.m,v
retrieving revision 1.121
diff -u -d -r1.121 mode_util.m
--- compiler/mode_util.m 2000/03/28 03:40:27 1.121
+++ compiler/mode_util.m 2000/04/17 20:29:49
@@ -63,6 +63,10 @@
:- pred mode_to_arg_mode(module_info, mode, type, arg_mode).
:- mode mode_to_arg_mode(in, in, in, out) is det.
+:- pred modes_to_arg_modes(module_info, list(mode), list(type),
+ list(arg_mode)).
+:- mode modes_to_arg_modes(in, in, in, out) is det.
+
% Given an expanded inst and a cons_id and its arity, return the
% insts of the arguments of the top level functor, failing if the
% inst could not be bound to the functor.
@@ -295,6 +299,17 @@
inst_is_free(ModuleInfo, FinalInst).
%-----------------------------------------------------------------------------%
+
+modes_to_arg_modes(ModuleInfo, Modes, Types, ArgModes) :-
+ ( Modes = [], Types = [] ->
+ ArgModes = []
+ ; Modes = [Mode | Modes1], Types = [Type | Types1] ->
+ mode_to_arg_mode(ModuleInfo, Mode, Type, ArgMode),
+ modes_to_arg_modes(ModuleInfo, Modes1, Types1, ArgModes1),
+ ArgModes = [ArgMode | ArgModes1]
+ ;
+ error("modes_to_arg_modes: length mismatch")
+ ).
mode_to_arg_mode(ModuleInfo, Mode, Type, ArgMode) :-
mode_to_arg_mode_2(ModuleInfo, Mode, Type, [], ArgMode).
Index: code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -u -r1.120 -r1.121
--- code_util.m 2000/04/17 10:32:06 1.120
+++ code_util.m 2000/04/19 03:54:03 1.121
@@ -280,6 +280,7 @@
code_util__make_proc_label_from_rtti(RttiProcLabel, ProcLabel) :-
RttiProcLabel = rtti_proc_label(PredOrFunc, ThisModule,
PredModule, PredName, PredArity, ArgTypes, _PredId, ProcId,
+ _VarSet, _HeadVars, _ArgModes, _CodeModel,
IsImported, _IsPseudoImported, _IsExported,
IsSpecialPredInstance),
(
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list