[m-rev.] diff: hlc.agc fixes
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Oct 23 19:38:28 AEST 2003
Estimated hours taken: 0.75
Branches: main
Fix recently-introduced compilation errors in grade hlc.agc.
runtime/mercury_engine.c:
runtime/mercury_trace_base.c:
Add `#ifndef MR_HIGHLEVEL_CODE ... #endif'
around LLDS-specific parts of the runtime system.
runtime/mercury_type_tables.c:
Add a missing #include directive.
Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: runtime/mercury_engine.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.c,v
retrieving revision 1.44
diff -u -d -r1.44 mercury_engine.c
--- runtime/mercury_engine.c 1 Jun 2003 06:52:35 -0000 1.44
+++ runtime/mercury_engine.c 23 Oct 2003 08:20:44 -0000
@@ -20,20 +20,24 @@
#include "mercury_dummy.h"
-#ifdef MR_USE_GCC_NONLOCAL_GOTOS
+#ifndef MR_HIGHLEVEL_CODE
-#define LOCALS_SIZE 10024 /* amount of space to reserve for local vars */
-#define MAGIC_MARKER 187 /* a random character */
-#define MAGIC_MARKER_2 142 /* another random character */
+ #ifdef MR_USE_GCC_NONLOCAL_GOTOS
-#endif
+ #define LOCALS_SIZE 10024 /* amount of space to reserve for local vars */
+ #define MAGIC_MARKER 187 /* a random character */
+ #define MAGIC_MARKER_2 142 /* another random character */
-static void call_engine_inner(MR_Code *entry_point) MR_NO_RETURN;
+ #endif /* MR_USE_GCC_NONLOCAL_GOTOS */
-#ifndef MR_USE_GCC_NONLOCAL_GOTOS
- static MR_Code *engine_done(void);
- static MR_Code *engine_init_registers(void);
-#endif
+ static void call_engine_inner(MR_Code *entry_point) MR_NO_RETURN;
+
+ #ifndef MR_USE_GCC_NONLOCAL_GOTOS
+ static MR_Code *engine_done(void);
+ static MR_Code *engine_init_registers(void);
+ #endif
+
+#endif /* !MR_HIGHLEVEL_CODE */
MR_bool MR_debugflag[MR_MAXFLAG];
@@ -180,6 +184,17 @@
/*---------------------------------------------------------------------------*/
+#ifdef MR_HIGHLEVEL_CODE
+
+/*
+** This debugging hook is empty in the high-level code case:
+** we don't save the previous locations.
+*/
+void
+MR_dump_prev_locations(void) {}
+
+#else /* !MR_HIGHLEVEL_CODE */
+
/*
** MR_Word *
** MR_call_engine(MR_Code *entry_point, MR_bool catch_exceptions)
@@ -667,6 +682,8 @@
} /* end call_engine_inner() */
#endif /* not MR_USE_GCC_NONLOCAL_GOTOS */
+#endif /* !MR_HIGHLEVEL_CODE */
+
/*---------------------------------------------------------------------------*/
void
@@ -680,6 +697,8 @@
/*---------------------------------------------------------------------------*/
+#ifndef MR_HIGHLEVEL_CODE
+
MR_define_extern_entry(MR_do_redo);
MR_define_extern_entry(MR_do_fail);
MR_define_extern_entry(MR_do_succeed);
@@ -723,6 +742,8 @@
MR_END_MODULE
+#endif /* !MR_HIGHLEVEL_CODE */
+
/* forward decls to suppress gcc warnings */
void mercury_sys_init_engine_init(void);
void mercury_sys_init_engine_init_type_tables(void);
@@ -732,7 +753,9 @@
void mercury_sys_init_engine_init(void)
{
+#ifndef MR_HIGHLEVEL_CODE
special_labels_module();
+#endif
}
void mercury_sys_init_engine_init_type_tables(void)
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.53
diff -u -d -r1.53 mercury_trace_base.c
--- runtime/mercury_trace_base.c 20 Oct 2003 07:29:32 -0000 1.53
+++ runtime/mercury_trace_base.c 23 Oct 2003 08:13:26 -0000
@@ -500,6 +500,8 @@
#endif /* MR_TRACE_HISTOGRAM */
+#ifndef MR_HIGHLEVEL_CODE
+
MR_define_extern_entry(MR_do_trace_redo_fail_shallow);
MR_define_extern_entry(MR_do_trace_redo_fail_deep);
@@ -554,6 +556,8 @@
MR_END_MODULE
+#endif /* !MR_HIGHLEVEL_CODE */
+
/* forward decls to suppress gcc warnings */
void mercury_sys_init_trace_init(void);
void mercury_sys_init_trace_init_type_tables(void);
@@ -563,7 +567,9 @@
void mercury_sys_init_trace_init(void)
{
+#ifndef MR_HIGHLEVEL_CODE
MR_trace_labels_module();
+#endif
}
void mercury_sys_init_trace_init_type_tables(void)
Index: runtime/mercury_type_tables.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_tables.c,v
retrieving revision 1.8
diff -u -d -r1.8 mercury_type_tables.c
--- runtime/mercury_type_tables.c 23 Oct 2003 02:02:31 -0000 1.8
+++ runtime/mercury_type_tables.c 23 Oct 2003 08:14:35 -0000
@@ -21,6 +21,7 @@
#include "mercury_type_tables.h"
#include "mercury_tabling.h"
#include "mercury_misc.h"
+#include "mercury_memory.h"
#include <string.h>
/*
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list