Tabling round 2 [3/3]
Oliver Hutchison
ohutch at students.cs.mu.OZ.AU
Mon Mar 23 13:42:58 AEDT 1998
On Wed, 18 Mar 1998, Fergus Henderson wrote:
> > table_gen__process_module(Module0, Module) :-
> > module_info_preds(Module0, Preds0),
> > map__keys(Preds0, PredIds),
> > table_gen__process_preds(PredIds, Module0, Module).
> >
> > :- pred table_gen__process_preds(list(pred_id), module_info, module_info).
> > :- mode table_gen__process_preds(in, in, out) is det.
> >
> > table_gen__process_preds([], Module, Module).
> > table_gen__process_preds([PredId | PredIds], Module0, Module) :-
> > table_gen__process_pred(PredId, Module0, Module1),
> > table_gen__process_preds(PredIds, Module1, Module).
> >
> > :- pred table_gen__process_pred(pred_id, module_info, module_info).
> > :- mode table_gen__process_pred(in, in, out) is det.
> >
> > table_gen__process_pred(PredId, Module0, Module) :-
> > module_info_pred_info(Module0, PredId, PredInfo),
> > pred_info_procids(PredInfo, ProcIds),
> > table_gen__process_procs(PredId, ProcIds, Module0, Module).
> >
> > :- pred table_gen__process_procs(pred_id, list(proc_id),
> > module_info, module_info).
> > :- mode table_gen__process_procs(in, in, in, out) is det.
> > table_gen__process_procs(_PredId, [], Module, Module).
> > table_gen__process_procs(PredId, [ProcId | ProcIds], Module0,
> > Module) :-
> > module_info_preds(Module0, PredTable),
> > map__lookup(PredTable, PredId, PredInfo),
> > pred_info_procedures(PredInfo, ProcTable),
> > map__lookup(ProcTable, ProcId, ProcInfo),
>
> Any particular reason why this code doesn't use the routines
> in passes_aux.m?
>
Yes. I use both the pred and proc infos in my code, the routines in
passes_aux.m don't pass me the proc infos I want. I could use the
pred_proc_id and the module_info to get the proc infos but that would have
to be done for every proc instead of just once for each pred.
More information about the developers
mailing list