[m-rev.] diff: add MR_external_fatal_error() to runtime

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Sep 10 22:59:53 AEST 2010


Add a new runtime function MR_external_fatal_error(), that works like
MR_fatal_error(), except that instead of prefixing the error message with
"Mercury runtime :", the caller can select the prefix.  This is intended
for use from library bindings and other external software, e.g. G12, where
reporting the error as occurring in the Mercury runtime is inaccurate.

runtime/mercury_misc.h:
 	Add a prototype for the new function.

 	Use 4-space indentation throughout.

runtime/mercury_misc.c:
 	Implement the new function.

Julien.

Index: runtime/mercury_misc.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_misc.c,v
retrieving revision 1.28
diff -u -r1.28 mercury_misc.c
--- runtime/mercury_misc.c	14 Nov 2006 00:15:40 -0000	1.28
+++ runtime/mercury_misc.c	10 Sep 2010 12:32:27 -0000
@@ -106,6 +106,28 @@
      exit(EXIT_FAILURE);
  }

+void
+MR_external_fatal_error(const char *locn, const char *fmt, ...)
+{
+    va_list args;
+
+    fflush(stdout);     /* in case stdout and stderr are the same */
+
+    fprintf(stderr, "%s: ", locn);
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+    fprintf(stderr, "\n");
+
+#ifndef MR_HIGHLEVEL_CODE
+    MR_trace_report(stderr);
+#endif
+
+    fflush(NULL);       /* flushes all stdio output streams */
+
+    exit(EXIT_FAILURE);
+}
+
  typedef struct {
      void    (*func)(void *);
      void    *data;
Index: runtime/mercury_misc.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_misc.h,v
retrieving revision 1.29
diff -u -r1.29 mercury_misc.h
--- runtime/mercury_misc.h	30 Oct 2009 03:33:29 -0000	1.29
+++ runtime/mercury_misc.h	10 Sep 2010 12:45:38 -0000
@@ -1,47 +1,71 @@
  /*
+** vim:ts=4 sw=4 expandtab
+*/
+/*
  ** Copyright (C) 1995-2000,2002, 2004, 2006, 2009 The University of Melbourne.
  ** This file may only be copied under the terms of the GNU Library General
  ** Public License - see the file COPYING.LIB in the Mercury distribution.
  */

  /*
-** mercury_misc.h -	MR_warning(),
-**			MR_fatal_error()
+** mercury_misc.h - MR_warning(),
+**                  MR_fatal_error()
  */

-#ifndef	MERCURY_MISC_H
-#define	MERCURY_MISC_H
+#ifndef MERCURY_MISC_H
+#define MERCURY_MISC_H

-#include "mercury_std.h"	/* for `MR_NO_RETURN' */
-#include <stdlib.h>		/* for `size_t' */
+#include "mercury_std.h"    /* for `MR_NO_RETURN' */
+#include <stdlib.h>         /* for `size_t' */

-extern	void	MR_warning(const char *msg, ...);
+extern void
+MR_warning(const char *msg, ...);

-	/* For warnings from the debugger */
-extern	void	MR_mdb_warning(const char *msg, ...);
+/*
+** For warnings from the debugger.
+*/
+extern void
+MR_mdb_warning(const char *msg, ...);

-extern	void	MR_perror(const char *msg);
+extern void
+MR_perror(const char *msg);

-	/* For errors from the debugger */
-extern	void	MR_mdb_perror(const char *msg);
+/*
+**For errors from the debugger.
+*/
+extern void
+MR_mdb_perror(const char *msg);

-extern	void	MR_fatal_error(const char *msg, ...) MR_NO_RETURN;
+/*
+** Output a message to standard error and abort.
+** This function is for fatal errors in the Mercury runtime.
+*/
+extern void
+MR_fatal_error(const char *msg, ...) MR_NO_RETURN;
+
+/*
+** Output a message to standard error and abort.
+** Prefix the message with the location of the component that caused the
+** error.
+** This is intended to be called from library bindings etc.
+*/
+extern void
+MR_external_fatal_error(const char *locn, const char *msg, ...) MR_NO_RETURN;

  /*
  ** Register a function to be called (as func(data)) when the program is
  ** about to be terminated due to an uncaught exception.
  */
-
-extern	void	MR_register_exception_cleanup(void (*func)(void *),
-			void *data);
+extern void
+MR_register_exception_cleanup(void (*func)(void *), void *data);

  /*
  ** Call all the functions registered with MR_register_exception_cleanup.
  ** Should be invoked only when the program is about to be terminated
  ** due to an uncaught exception.
  */
-
-extern	void	MR_perform_registered_exception_cleanups(void);
+extern void
+MR_perform_registered_exception_cleanups(void);

  /*---------------------------------------------------------------------------*/

@@ -50,310 +74,310 @@
  ** generated C source files.
  */

-#define	MR_COMMON_TYPE(typenum)						\
-	MR_PASTE2(mercury_type_, typenum)
+#define MR_COMMON_TYPE(typenum)                     \
+    MR_PASTE2(mercury_type_, typenum)

-#define	MR_COMMON_NAME(cellnum)						\
-	MR_PASTE2(mercury_common_, cellnum)
+#define MR_COMMON_NAME(cellnum)                     \
+    MR_PASTE2(mercury_common_, cellnum)

-#define	MR_COMMON(typenum, cellnum)					\
-	((MR_Word *) &MR_COMMON_NAME(typenum)[cellnum])
+#define MR_COMMON(typenum, cellnum)                 \
+    ((MR_Word *) &MR_COMMON_NAME(typenum)[cellnum])

-#define	MR_XCOMMON(typenum, cellnum)					\
-	((MR_Word *) &MR_COMMON_NAME(typenum)[cellnum])
+#define MR_XCOMMON(typenum, cellnum)                    \
+    ((MR_Word *) &MR_COMMON_NAME(typenum)[cellnum])

-#define	MR_TAG_COMMON(tag, typenum, cellnum)				\
-	(MR_mkword(MR_mktag(tag), MR_COMMON(typenum, cellnum)))
+#define MR_TAG_COMMON(tag, typenum, cellnum)                \
+    (MR_mkword(MR_mktag(tag), MR_COMMON(typenum, cellnum)))

-#define	MR_TAG_XCOMMON(tag, typenum, cellnum)				\
-	(MR_mkword(MR_mktag(tag), MR_XCOMMON(typenum, cellnum)))
+#define MR_TAG_XCOMMON(tag, typenum, cellnum)               \
+    (MR_mkword(MR_mktag(tag), MR_XCOMMON(typenum, cellnum)))

  /*---------------------------------------------------------------------------*/

-#define	MR_pseudo_type_infos(m)						\
-	MR_PASTE2(mercury_data__pseudo_type_info_array__, m)
+#define MR_pseudo_type_infos(m)                     \
+    MR_PASTE2(mercury_data__pseudo_type_info_array__, m)

-#define	MR_hlds_var_nums(m)						\
-	MR_PASTE2(mercury_data__hlds_var_nums_array__, m)
+#define MR_hlds_var_nums(m)                     \
+    MR_PASTE2(mercury_data__hlds_var_nums_array__, m)

-#define	MR_short_locns(m)						\
-	MR_PASTE2(mercury_data__short_locns_array__, m)
+#define MR_short_locns(m)                       \
+    MR_PASTE2(mercury_data__short_locns_array__, m)

-#define	MR_long_locns(m)						\
-	MR_PASTE2(mercury_data__long_locns_array__, m)
+#define MR_long_locns(m)                        \
+    MR_PASTE2(mercury_data__long_locns_array__, m)

-#define	MR_user_event_var_nums(m)					\
-	MR_PASTE2(mercury_data__user_event_var_nums_array__, m)
+#define MR_user_event_var_nums(m)                   \
+    MR_PASTE2(mercury_data__user_event_var_nums_array__, m)

-#define	MR_user_event_layouts(m)					\
-	MR_PASTE2(mercury_data__user_event_layouts_array__, m)
+#define MR_user_event_layouts(m)                    \
+    MR_PASTE2(mercury_data__user_event_layouts_array__, m)

-#define	MR_no_var_label_layouts(m)					\
-	MR_PASTE2(mercury_data__no_var_label_layout_array__, m)
+#define MR_no_var_label_layouts(m)                  \
+    MR_PASTE2(mercury_data__no_var_label_layout_array__, m)

-#define	MR_svar_label_layouts(m)					\
-	MR_PASTE2(mercury_data__svar_label_layout_array__, m)
+#define MR_svar_label_layouts(m)                    \
+    MR_PASTE2(mercury_data__svar_label_layout_array__, m)

-#define	MR_lvar_label_layouts(m)					\
-	MR_PASTE2(mercury_data__lvar_label_layout_array__, m)
+#define MR_lvar_label_layouts(m)                    \
+    MR_PASTE2(mercury_data__lvar_label_layout_array__, m)

  /*---------------------------------------------------------------------------*/

-#define	MR_proc_call_sites(m)						\
-	MR_PASTE2(mercury_data__proc_call_sites_array__, m)
+#define MR_proc_call_sites(m)                       \
+    MR_PASTE2(mercury_data__proc_call_sites_array__, m)

-#define	MR_proc_cp_statics(m)						\
-	MR_PASTE2(mercury_data__proc_cp_statics_array__, m)
+#define MR_proc_cp_statics(m)                       \
+    MR_PASTE2(mercury_data__proc_cp_statics_array__, m)

-#define	MR_proc_cp_dynamics(m)						\
-	MR_PASTE2(mercury_data__proc_cp_dynamics_array__, m)
+#define MR_proc_cp_dynamics(m)                      \
+    MR_PASTE2(mercury_data__proc_cp_dynamics_array__, m)

-#define	MR_proc_statics(m)						\
-	MR_PASTE2(mercury_data__proc_statics_array__, m)
+#define MR_proc_statics(m)                      \
+    MR_PASTE2(mercury_data__proc_statics_array__, m)

-#define	MR_proc_head_var_nums(m)					\
-	MR_PASTE2(mercury_data__proc_head_var_nums_array__, m)
+#define MR_proc_head_var_nums(m)                    \
+    MR_PASTE2(mercury_data__proc_head_var_nums_array__, m)

-#define	MR_proc_var_names(m)						\
-	MR_PASTE2(mercury_data__proc_var_names_array__, m)
+#define MR_proc_var_names(m)                        \
+    MR_PASTE2(mercury_data__proc_var_names_array__, m)

-#define	MR_proc_body_bytecodes(m)					\
-	MR_PASTE2(mercury_data__proc_body_bytecodes_array__, m)
+#define MR_proc_body_bytecodes(m)                   \
+    MR_PASTE2(mercury_data__proc_body_bytecodes_array__, m)

-#define	MR_proc_table_io_decls(m)					\
-	MR_PASTE2(mercury_data__proc_table_io_decls_array__, m)
+#define MR_proc_table_io_decls(m)                   \
+    MR_PASTE2(mercury_data__proc_table_io_decls_array__, m)

-#define	MR_proc_event_layouts(m)					\
-	MR_PASTE2(mercury_data__proc_event_layouts_array__, m)
+#define MR_proc_event_layouts(m)                    \
+    MR_PASTE2(mercury_data__proc_event_layouts_array__, m)

-#define	MR_proc_exec_traces(m)						\
-	MR_PASTE2(mercury_data__proc_exec_traces_array__, m)
+#define MR_proc_exec_traces(m)                      \
+    MR_PASTE2(mercury_data__proc_exec_traces_array__, m)

  /*---------------------------------------------------------------------------*/

-#define	MR_no_var_label_layout_refs1(m, s1)				\
-	&MR_no_var_label_layouts(m)[s1],
+#define MR_no_var_label_layout_refs1(m, s1)             \
+    &MR_no_var_label_layouts(m)[s1],

-#define	MR_no_var_label_layout_refs2(m, s1, s2)				\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)
-
-#define	MR_no_var_label_layout_refs3(m, s1, s2, s3) 			\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)
-
-#define	MR_no_var_label_layout_refs4(m, s1, s2, s3, s4) 		\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)
-
-#define	MR_no_var_label_layout_refs5(m, s1, s2, s3, s4, s5) 		\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)
-
-#define	MR_no_var_label_layout_refs6(m, s1, s2, s3, s4, s5, s6) 	\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)				\
-	MR_no_var_label_layout_refs1(m, s6)
-
-#define	MR_no_var_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7) 	\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)				\
-	MR_no_var_label_layout_refs1(m, s6)				\
-	MR_no_var_label_layout_refs1(m, s7)
-
-#define	MR_no_var_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8)	\
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)				\
-	MR_no_var_label_layout_refs1(m, s6)				\
-	MR_no_var_label_layout_refs1(m, s7)				\
-	MR_no_var_label_layout_refs1(m, s8)
-
-#define	MR_no_var_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)				\
-	MR_no_var_label_layout_refs1(m, s6)				\
-	MR_no_var_label_layout_refs1(m, s7)				\
-	MR_no_var_label_layout_refs1(m, s8)				\
-	MR_no_var_label_layout_refs1(m, s9)
-
-#define	MR_no_var_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
-	MR_no_var_label_layout_refs1(m, s1)				\
-	MR_no_var_label_layout_refs1(m, s2)				\
-	MR_no_var_label_layout_refs1(m, s3)				\
-	MR_no_var_label_layout_refs1(m, s4)				\
-	MR_no_var_label_layout_refs1(m, s5)				\
-	MR_no_var_label_layout_refs1(m, s6)				\
-	MR_no_var_label_layout_refs1(m, s7)				\
-	MR_no_var_label_layout_refs1(m, s8)				\
-	MR_no_var_label_layout_refs1(m, s9)				\
-	MR_no_var_label_layout_refs1(m, s10)
-
-#define	MR_svar_label_layout_refs1(m, s1)				\
-	(MR_LabelLayout *) &MR_svar_label_layouts(m)[s1],
-
-#define	MR_svar_label_layout_refs2(m, s1, s2) 				\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)
-
-#define	MR_svar_label_layout_refs3(m, s1, s2, s3) 			\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)
-
-#define	MR_svar_label_layout_refs4(m, s1, s2, s3, s4) 			\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)
-
-#define	MR_svar_label_layout_refs5(m, s1, s2, s3, s4, s5) 		\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)
-
-#define	MR_svar_label_layout_refs6(m, s1, s2, s3, s4, s5, s6) 		\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)				\
-	MR_svar_label_layout_refs1(m, s6)
-
-#define	MR_svar_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7) 	\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)				\
-	MR_svar_label_layout_refs1(m, s6)				\
-	MR_svar_label_layout_refs1(m, s7)
-
-#define	MR_svar_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8) 	\
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)				\
-	MR_svar_label_layout_refs1(m, s6)				\
-	MR_svar_label_layout_refs1(m, s7)				\
-	MR_svar_label_layout_refs1(m, s8)
-
-#define	MR_svar_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)				\
-	MR_svar_label_layout_refs1(m, s6)				\
-	MR_svar_label_layout_refs1(m, s7)				\
-	MR_svar_label_layout_refs1(m, s8)				\
-	MR_svar_label_layout_refs1(m, s9)
-
-#define	MR_svar_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
-	MR_svar_label_layout_refs1(m, s1)				\
-	MR_svar_label_layout_refs1(m, s2)				\
-	MR_svar_label_layout_refs1(m, s3)				\
-	MR_svar_label_layout_refs1(m, s4)				\
-	MR_svar_label_layout_refs1(m, s5)				\
-	MR_svar_label_layout_refs1(m, s6)				\
-	MR_svar_label_layout_refs1(m, s7)				\
-	MR_svar_label_layout_refs1(m, s8)				\
-	MR_svar_label_layout_refs1(m, s9)				\
-	MR_svar_label_layout_refs1(m, s10)
-
-#define	MR_lvar_label_layout_refs1(m, s1)				\
-	&MR_lvar_label_layouts(m)[s1],
-
-#define	MR_lvar_label_layout_refs2(m, s1, s2) 				\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)
-
-#define	MR_lvar_label_layout_refs3(m, s1, s2, s3) 			\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)
-
-#define	MR_lvar_label_layout_refs4(m, s1, s2, s3, s4) 			\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)
-
-#define	MR_lvar_label_layout_refs5(m, s1, s2, s3, s4, s5) 		\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)
-
-#define	MR_lvar_label_layout_refs6(m, s1, s2, s3, s4, s5, s6) 		\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)				\
-	MR_lvar_label_layout_refs1(m, s6)
-
-#define	MR_lvar_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7) 	\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)				\
-	MR_lvar_label_layout_refs1(m, s6)				\
-	MR_lvar_label_layout_refs1(m, s7)
-
-#define	MR_lvar_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8) 	\
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)				\
-	MR_lvar_label_layout_refs1(m, s6)				\
-	MR_lvar_label_layout_refs1(m, s7)				\
-	MR_lvar_label_layout_refs1(m, s8)
-
-#define	MR_lvar_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)				\
-	MR_lvar_label_layout_refs1(m, s6)				\
-	MR_lvar_label_layout_refs1(m, s7)				\
-	MR_lvar_label_layout_refs1(m, s8)				\
-	MR_lvar_label_layout_refs1(m, s9)
-
-#define	MR_lvar_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
-	MR_lvar_label_layout_refs1(m, s1)				\
-	MR_lvar_label_layout_refs1(m, s2)				\
-	MR_lvar_label_layout_refs1(m, s3)				\
-	MR_lvar_label_layout_refs1(m, s4)				\
-	MR_lvar_label_layout_refs1(m, s5)				\
-	MR_lvar_label_layout_refs1(m, s6)				\
-	MR_lvar_label_layout_refs1(m, s7)				\
-	MR_lvar_label_layout_refs1(m, s8)				\
-	MR_lvar_label_layout_refs1(m, s9)				\
-	MR_lvar_label_layout_refs1(m, s10)
+#define MR_no_var_label_layout_refs2(m, s1, s2)             \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)
+
+#define MR_no_var_label_layout_refs3(m, s1, s2, s3)             \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)
+
+#define MR_no_var_label_layout_refs4(m, s1, s2, s3, s4)         \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)
+
+#define MR_no_var_label_layout_refs5(m, s1, s2, s3, s4, s5)         \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)
+
+#define MR_no_var_label_layout_refs6(m, s1, s2, s3, s4, s5, s6)     \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)             \
+    MR_no_var_label_layout_refs1(m, s6)
+
+#define MR_no_var_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7)     \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)             \
+    MR_no_var_label_layout_refs1(m, s6)             \
+    MR_no_var_label_layout_refs1(m, s7)
+
+#define MR_no_var_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8) \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)             \
+    MR_no_var_label_layout_refs1(m, s6)             \
+    MR_no_var_label_layout_refs1(m, s7)             \
+    MR_no_var_label_layout_refs1(m, s8)
+
+#define MR_no_var_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)             \
+    MR_no_var_label_layout_refs1(m, s6)             \
+    MR_no_var_label_layout_refs1(m, s7)             \
+    MR_no_var_label_layout_refs1(m, s8)             \
+    MR_no_var_label_layout_refs1(m, s9)
+
+#define MR_no_var_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
+    MR_no_var_label_layout_refs1(m, s1)             \
+    MR_no_var_label_layout_refs1(m, s2)             \
+    MR_no_var_label_layout_refs1(m, s3)             \
+    MR_no_var_label_layout_refs1(m, s4)             \
+    MR_no_var_label_layout_refs1(m, s5)             \
+    MR_no_var_label_layout_refs1(m, s6)             \
+    MR_no_var_label_layout_refs1(m, s7)             \
+    MR_no_var_label_layout_refs1(m, s8)             \
+    MR_no_var_label_layout_refs1(m, s9)             \
+    MR_no_var_label_layout_refs1(m, s10)
+
+#define MR_svar_label_layout_refs1(m, s1)               \
+    (MR_LabelLayout *) &MR_svar_label_layouts(m)[s1],
+
+#define MR_svar_label_layout_refs2(m, s1, s2)       \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)
+
+#define MR_svar_label_layout_refs3(m, s1, s2, s3)   \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)
+
+#define MR_svar_label_layout_refs4(m, s1, s2, s3, s4)           \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)
+
+#define MR_svar_label_layout_refs5(m, s1, s2, s3, s4, s5)       \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)
+
+#define MR_svar_label_layout_refs6(m, s1, s2, s3, s4, s5, s6)       \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)               \
+    MR_svar_label_layout_refs1(m, s6)
+
+#define MR_svar_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7)   \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)               \
+    MR_svar_label_layout_refs1(m, s6)               \
+    MR_svar_label_layout_refs1(m, s7)
+
+#define MR_svar_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8)   \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)               \
+    MR_svar_label_layout_refs1(m, s6)               \
+    MR_svar_label_layout_refs1(m, s7)               \
+    MR_svar_label_layout_refs1(m, s8)
+
+#define MR_svar_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)               \
+    MR_svar_label_layout_refs1(m, s6)               \
+    MR_svar_label_layout_refs1(m, s7)               \
+    MR_svar_label_layout_refs1(m, s8)               \
+    MR_svar_label_layout_refs1(m, s9)
+
+#define MR_svar_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
+    MR_svar_label_layout_refs1(m, s1)               \
+    MR_svar_label_layout_refs1(m, s2)               \
+    MR_svar_label_layout_refs1(m, s3)               \
+    MR_svar_label_layout_refs1(m, s4)               \
+    MR_svar_label_layout_refs1(m, s5)               \
+    MR_svar_label_layout_refs1(m, s6)               \
+    MR_svar_label_layout_refs1(m, s7)               \
+    MR_svar_label_layout_refs1(m, s8)               \
+    MR_svar_label_layout_refs1(m, s9)               \
+    MR_svar_label_layout_refs1(m, s10)
+
+#define MR_lvar_label_layout_refs1(m, s1)           \
+    &MR_lvar_label_layouts(m)[s1],
+
+#define MR_lvar_label_layout_refs2(m, s1, s2)       \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)
+
+#define MR_lvar_label_layout_refs3(m, s1, s2, s3)   \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)
+
+#define MR_lvar_label_layout_refs4(m, s1, s2, s3, s4)           \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)
+
+#define MR_lvar_label_layout_refs5(m, s1, s2, s3, s4, s5)       \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)
+
+#define MR_lvar_label_layout_refs6(m, s1, s2, s3, s4, s5, s6)       \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)               \
+    MR_lvar_label_layout_refs1(m, s6)
+
+#define MR_lvar_label_layout_refs7(m, s1, s2, s3, s4, s5, s6, s7)   \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)               \
+    MR_lvar_label_layout_refs1(m, s6)               \
+    MR_lvar_label_layout_refs1(m, s7)
+
+#define MR_lvar_label_layout_refs8(m, s1, s2, s3, s4, s5, s6, s7, s8)   \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)               \
+    MR_lvar_label_layout_refs1(m, s6)               \
+    MR_lvar_label_layout_refs1(m, s7)               \
+    MR_lvar_label_layout_refs1(m, s8)
+
+#define MR_lvar_label_layout_refs9(m, s1, s2, s3, s4, s5, s6, s7, s8, s9) \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)               \
+    MR_lvar_label_layout_refs1(m, s6)               \
+    MR_lvar_label_layout_refs1(m, s7)               \
+    MR_lvar_label_layout_refs1(m, s8)               \
+    MR_lvar_label_layout_refs1(m, s9)
+
+#define MR_lvar_label_layout_refs10(m, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10) \
+    MR_lvar_label_layout_refs1(m, s1)               \
+    MR_lvar_label_layout_refs1(m, s2)               \
+    MR_lvar_label_layout_refs1(m, s3)               \
+    MR_lvar_label_layout_refs1(m, s4)               \
+    MR_lvar_label_layout_refs1(m, s5)               \
+    MR_lvar_label_layout_refs1(m, s6)               \
+    MR_lvar_label_layout_refs1(m, s7)               \
+    MR_lvar_label_layout_refs1(m, s8)               \
+    MR_lvar_label_layout_refs1(m, s9)               \
+    MR_lvar_label_layout_refs1(m, s10)

  #endif /* not MERCURY_MISC_H */

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list