[m-dev.] for review: bug fixes & cleanups in runtime/*

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Nov 10 11:01:55 AEDT 1998


> runtime/mercury_imp.h:
> 	Make mercury_bootstrap the first header file that is #included,
> 	in case some of the macros defined in it are used in declarations
> 	in other header files.

Are there any occasions where that is the case? I don't believe so.
I even have difficulty imagining situations where the scenario you describe
would be the right approach to solving a problem.

I think it far more likely that mercury_bootstrap.h would hold old,
non-name-space-clean macros defined in terms of their new, name-space-clean
alternatives. I know that the current contents of mercury_bootstrap.h
is like that, because I created it like that. That is why I put the
#include of mercury_bootstrap.h last in mercury_imp.h.

> --- mercury_bootstrap.h	1998/11/05 06:27:41	1.1
> +++ mercury_bootstrap.h	1998/11/09 11:18:21
> ...
> +#define succip		MR_succip
> +#define hp		MR_hp
> +#define sp		MR_sp
> +#define curfr		MR_curfr
> +#define maxfr		MR_maxfr
> +
> +#define TYPELAYOUT_UNASSIGNED_VALUE	(MR_TYPELAYOUT_UNASSIGNED_VALUE)
> +#define TYPELAYOUT_UNUSED_VALUE		(MR_TYPELAYOUT_UNUSED_VALUE)
> +#define TYPELAYOUT_STRING_VALUE		(MR_TYPELAYOUT_STRING_VALUE)
> +#define TYPELAYOUT_FLOAT_VALUE		(MR_TYPELAYOUT_FLOAT_VALUE)
> +#define TYPELAYOUT_INT_VALUE		(MR_TYPELAYOUT_INT_VALUE)
> +#define TYPELAYOUT_CHARACTER_VALUE	(MR_TYPELAYOUT_CHARACTER_VALUE)
> +#define TYPELAYOUT_UNIV_VALUE		(MR_TYPELAYOUT_UNIV_VALUE)
> +#define TYPELAYOUT_PREDICATE_VALUE	(MR_TYPELAYOUT_PREDICATE_VALUE)
> +#define TYPELAYOUT_VOID_VALUE		(MR_TYPELAYOUT_VOID_VALUE)
> +#define TYPELAYOUT_ARRAY_VALUE		(MR_TYPELAYOUT_ARRAY_VALUE)
> +#define TYPELAYOUT_TYPEINFO_VALUE	(MR_TYPELAYOUT_TYPEINFO_VALUE)
> +#define TYPELAYOUT_C_POINTER_VALUE	(MR_TYPELAYOUT_C_POINTER_VALUE)
> +
> +#define	framevar(n)		MR_framevar((n) + 1)

The framevar definition should be close to the register definitions.
It should also be accompanied by the blocks of macro definitions headed
by the definitions of bt_prevfr and curprevfr from mercury_stacks.h,
as well as the definitions of detstackvar, push, pop and modframe.

> --- mercury_imp.h	1998/11/05 03:53:40	1.12
> +++ mercury_imp.h	1998/11/09 12:00:17
> @@ -20,6 +20,12 @@
>  #define MERCURY_IMP_H
>  
>  /*
> +** mercury_bootstrap.h should come first, since may defines macros
> +** used in other header files.
> +*/

Spelling error, as well an include in the wrong place.

Zoltan.



More information about the developers mailing list