for review: make HLDS mostly well-moded

David Glen JEFFERY dgj at cs.mu.OZ.AU
Tue Feb 10 14:23:11 AEDT 1998


On 10-Feb-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 09-Feb-1998, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> >  call_gen__generate_class_method_call(_OuterCodeModel, TCVar, MethodNum, Args,
> >  		Types, Modes, Det, GoalInfo, Code) -->
> >  	{ determinism_to_code_model(Det, InnerCodeModel) },
> >  	code_info__get_globals(Globals),
> >  	code_info__get_module_info(ModuleInfo),
> > +
> > +	% XXX must be compact
> >  	{ globals__get_args_method(Globals, ArgsMethod) },
> >  	{ make_arg_infos(ArgsMethod, Types, Modes, InnerCodeModel, ModuleInfo,
> >  		ArgInfo) },
> 
> Good point.
> 
> The code should check this and abort if it is not true.
> (Either here, or in runtime/mercury_ho_call.c.)

Currently, the compilation will abort if there is a class method call without
compact args. This is checked in call_gen__generate_class_method_call_2: 

        % XXX This assumes compact args
:- pred call_gen__generate_class_method_call_2(code_model, var, int, list(var),
                list(var), hlds_goal_info, code_tree, code_info, code_info).
:- mode call_gen__generate_class_method_call_2(in, in, in, in, in, in, out, in,
                out) is det.

call_gen__generate_class_method_call_2(CodeModel, TCVar, Index, InVars, OutVars,
                GoalInfo, Code) -->
        code_info__get_globals(Globals),
        { globals__get_args_method(Globals, ArgsMethod) },
        (
                { ArgsMethod = compact }
        ->
                []
        ;
                { error("Sorry, typeclasses with simple args_method not yet impl
emented") }
        ),
	[...]


love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
MEngSc student,                 |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list