[m-dev.] for review: new method of handling failures, part 1 of 6

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jul 4 01:27:11 AEST 1998


On 03-Jul-1998, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> > > compiler/llds_out.m:
> > > 	Emit a #define MR_USE_REDOFR before including mercury_imp.h, to
> > > 	tell the runtime we are using the new failure handling scheme.
> > > 	This effectively changes the grade of the compiled module.
> > 
> > Hmm, what about the code in runtime/*.c, will that get MR_USE_REDOFR defined?
> 
> Not by this mechanism.
> 
> > If so, how?
> 
> I do it by including EXTRA_CFLAGS = -DMR_USE_REDOFR in Mmake.stage.params.
> After committing this, we will need to do the same for the workspaces used
> by the nightly scripts. When the change is installed on a machine, people
> with workspaces on the machine will need to include set EXTRA_CFLAGS in their
> Mmake.param when they recompile everything. When it is installed on everything,
> we can put #define MR_USE_REDOFR at the top of mercury_imp.h.
> 
> I told you the switchover would be complex.

Well, I'm sure the switchover will be complex, but I think you may be making
it more complex than it needs to be.

Why not do it this way:

	- in runtime/mercury_stacks.h, always define a redofr slot;
	  don't make this conditional on MR_USE_REDOFR.
	  (This should still work fine, even when compiling with
	  the old compiler.)

	- in runtime/mercury_grade.h, always include `redofr_' in the
	  mangled grade identifier (this prevents linking
	  code compiled with the old version of the runtime with
	  code compiled with the new version of the runtime)

(Note that even linking files compiled with the new compiler with files
compiled with the old compiler should be fine, so long as they were
all compiled with the new runtime.)

That way, we won't need to fool with the Mmake.params or Mmake.stage.params.
And you don't need to make bootcheck always copy the runtime.

All people will need to do is to wait until they get a compile error --
which will happen once the new compiler has been installed, when
they try to compile files using the new compiler but the old runtime --
and then do `cvs update runtime; mmake clean; mmake'.

> The change to llds_out is to force a *visible* as opposed to an invisible error
> if this somewhat complex protocol is violated.

I think the approach suggested above is significantly simpler and not
any more prone to invisible errors.  In fact, because it is simpler, it
is probably significantly less error prone.

Cheers,	
	Fergus.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list