[m-dev.] for review: nondet pragma C codes (part 1 of 2)

Tyson Dowd trd at cs.mu.oz.au
Wed Jan 14 17:28:45 AEDT 1998


On 09-Jan-1998, Fergus Henderson <fjh at cs.mu.oz.au> wrote:
> On 09-Jan-1998, Zoltan Somogyi <zs at cs.mu.oz.au> wrote:
> > -code_gen__generate_prolog(CodeModel, FrameInfo, PrologCode) -->
> > +code_gen__generate_prolog(CodeModel, Goal, FrameInfo, PrologCode) -->
> ...
> > +		(
> > +			{ Goal = pragma_c_code(_,_,_,_,_,_, PragmaCode) - _},
> > +			{ PragmaCode = nondet(Fields, FieldsContext,
> > +				_,_,_,_,_,_,_) }
> > +		->
> > +			{ pragma_c_gen__struct_name(ModuleName, PredName,
> > +				Arity, ProcId, StructName) },
> > +			{ Struct = pragma_struct(StructName,
> > +				Fields, FieldsContext) },
> > +			{ string__format("#define\tMR_ORDINARY_SLOTS\t%d\n",
> > +				[i(TotalSlots)], DefineStr) },
> > +			{ DefineComps = [pragma_c_raw_code(DefineStr)] },
> > +			{ AllocCode = node([
> > +				mkframe(PushMsg, TotalSlots, yes(Struct),
> > +					do_fail)
> > +					- "Allocate stack frame",
> > +				pragma_c([], DefineComps,
> > +					will_not_call_mercury, no)
> > +					- ""

etc etc etc

> Also, would it be reasonable to split some of the code in generate_prolog
> and generate_epilogue out into subroutines?  They're getting pretty long.

I was expecting this code to get another review before being committed, 
given the comments given at the review. Certainly the revised diff
should have at least been posted.

This problem in particular still needs to be fixed -- generate_epilog
in particular is now a very ugly predicate.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of
     trd at cs.mu.oz.au        #  fur.
http://www.cs.mu.oz.au/~trd #



More information about the developers mailing list