diff: move some useful code out of dnf.m

Andrew Bromage bromage at cs.mu.oz.au
Thu Oct 30 16:35:03 AEDT 1997


G'day.

Simon Taylor <stayl at cs.mu.OZ.AU> writes:

>Hi Zoltan,

The name's Andrew actually.  I need this change so I'll review it
instead.

>compiler/hlds_pred.m
>	Added predicates proc_info_add_variable and proc_info_add_variables
>	to add a new variable or list of variables given the types.

I think these names are misleading.  They don't capture the fact that
the variable added is _new_.  I can envisage situations where I might
want to add a variable that I've made elsewhere.

Perhaps proc_info_create_var_from_type and proc_info_create_vars_from_types
are a bit more evocative?

>+hlds_pred__define_new_pred(Goal0, Goal, ArgVars, InstMap0, PredName, TVarSet, 
>+		VarTypes, VarSet, Markers, ModuleInfo0,
>+		ModuleInfo, PredProcId) :-
>+	Goal0 = _GoalExpr - GoalInfo,
>+	goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
>+	instmap__apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
>+
>+	goal_info_get_context(GoalInfo, Context),
>+	goal_info_get_determinism(GoalInfo, Detism),
>+	compute_arg_types_modes(ArgVars, VarTypes, InstMap0, InstMap,
>+		ArgTypes, ArgModes),
>+
>+	module_info_name(ModuleInfo0, ModuleName),
>+	SymName = qualified(ModuleName, PredName),
>+	map__init(TVarMap), % later, polymorphism.m will fill this in. 

Should probably document that this must be run after polymorphism.m.

Apart from that, it looks fine to me.

Cheers,
Andrew Bromage



More information about the developers mailing list