for review: make the vartypes field of imported proc_infos useable
Zoltan Somogyi
zs at cs.mu.OZ.AU
Thu Sep 24 17:16:17 AEST 1998
This is for DJ to review, and Vanessa to use.
Make the vartypes field of imported proc_infos useable.
compiler/hlds_pred.m:
Add to proc_info_init an extra argument that specifies the types
of the head variables, and use this to initialize the proc_info's
vartypes field, instead of an empty map. For procedures defined
in the current module, this makes no difference, since the field is
set in mode checking (of all places) anyway. For imported procedures,
it actually makes the vartypes field useable by e.g. the new
termination analysis algorithm. Previously, for such procedures
the field contained a bogus map containing only the variables
introduced by polymorphism.
compiler/make_hlds.m:
Supply the extra argument to proc_info_init.
Zoltan.
cvs diff: Diffing .
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/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing bytecode/test
cvs diff: Diffing compiler
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.52
diff -u -u -r1.52 hlds_pred.m
--- hlds_pred.m 1998/09/10 06:51:16 1.52
+++ hlds_pred.m 1998/09/23 08:26:52
@@ -932,10 +932,10 @@
:- interface.
-:- pred proc_info_init(arity, list(mode), maybe(list(mode)),
+:- pred proc_info_init(arity, list(type), list(mode), maybe(list(mode)),
maybe(list(is_live)), maybe(determinism), term__context,
args_method, proc_info).
-:- mode proc_info_init(in, in, in, in, in, in, in, out) is det.
+:- mode proc_info_init(in, in, in, in, in, in, in, in, out) is det.
:- pred proc_info_set(maybe(determinism), varset, map(var, type), list(var),
list(mode), maybe(list(is_live)), hlds_goal, term__context,
@@ -1185,17 +1185,18 @@
% This is what `det_analysis.m' wants. det_analysis.m
% will later provide the correct inferred determinism for it.
-proc_info_init(Arity, Modes, DeclaredModes, MaybeArgLives,
+proc_info_init(Arity, Types, Modes, DeclaredModes, MaybeArgLives,
MaybeDet, MContext, ArgsMethod, NewProc) :-
- map__init(BodyTypes),
- goal_info_init(GoalInfo),
varset__init(BodyVarSet0),
make_n_fresh_vars("HeadVar__", Arity, BodyVarSet0,
HeadVars, BodyVarSet),
+ assoc_list__from_corresponding_lists(HeadVars, Types, HeadTypes),
+ map__from_assoc_list(HeadTypes, BodyTypes),
InferredDet = erroneous,
map__init(StackSlots),
set__init(InitialLiveness),
ArgInfo = [],
+ goal_info_init(GoalInfo),
ClauseBody = conj([]) - GoalInfo,
CanProcess = yes,
map__init(TVarsMap),
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.274
diff -u -u -r1.274 make_hlds.m
--- make_hlds.m 1998/09/22 23:08:29 1.274
+++ make_hlds.m 1998/09/24 04:20:11
@@ -1800,9 +1800,10 @@
add_new_proc(PredInfo0, Arity, ArgModes, MaybeDeclaredArgModes, MaybeArgLives,
MaybeDet, Context, ArgsMethod, PredInfo, ModeId) :-
pred_info_procedures(PredInfo0, Procs0),
+ pred_info_arg_types(PredInfo0, ArgTypes),
next_mode_id(Procs0, MaybeDet, ModeId),
- proc_info_init(Arity, ArgModes, MaybeDeclaredArgModes, MaybeArgLives,
- MaybeDet, Context, ArgsMethod, NewProc),
+ proc_info_init(Arity, ArgTypes, ArgModes, MaybeDeclaredArgModes,
+ MaybeArgLives, MaybeDet, Context, ArgsMethod, NewProc),
map__det_insert(Procs0, ModeId, NewProc, Procs),
pred_info_set_procedures(PredInfo0, Procs, PredInfo).
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
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/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/Togl-1.2
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/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
cvs diff: Diffing lp_solve
cvs diff: Diffing lp_solve/lp_examples
cvs diff: Diffing profiler
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 scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/general
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
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 trial
cvs diff: Diffing util
More information about the developers
mailing list