[m-dev.] diff: fix hlc.gc.prof undefined symbol bug
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Dec 21 14:42:34 AEDT 2000
I'll commit this on both the main and version-0_10_x branches.
----------
Estimated hours taken: 0.5
runtime/mercury_tabling.c:
Fix a bug in my previous change to add stubs for
table_nondet_suspend and table_nondet_resume:
the stubs need to be outside of the
`#ifdef MR_USE_MINIMAL_MODEL'.
Workspace: /home/pgrad/fjh/ws/hg
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.35
diff -u -d -r1.35 mercury_tabling.c
--- runtime/mercury_tabling.c 2000/12/18 14:21:19 1.35
+++ runtime/mercury_tabling.c 2000/12/21 03:40:23
@@ -1460,26 +1460,7 @@
** table_nondet_resume.
*/
-#ifdef MR_HIGHLEVEL_CODE
-
-void MR_CALL
-mercury__table_builtin__table_nondet_resume_1_p_0(
- MR_C_Pointer subgoal_table_node, MR_C_Pointer *answer_block,
- MR_Cont cont, void *cont_env_ptr)
-{
- MR_fatal_error("sorry, not implemented: "
- "minimal model tabling with --high-level-code");
-}
-
-void MR_CALL
-mercury__table_builtin__table_nondet_suspend_2_p_0(
- MR_C_Pointer subgoal_table_node)
-{
- MR_fatal_error("sorry, not implemented: "
- "minimal model tabling with --high-level-code");
-}
-
-#else /* ! MR_HIGHLEVEL_CODE */
+#ifndef MR_HIGHLEVEL_CODE
MR_declare_entry(mercury__table_nondet_resume_1_0);
MR_declare_entry(MR_do_trace_redo_fail);
@@ -1996,6 +1977,41 @@
#endif /* ! MR_HIGHLEVEL_CODE */
#endif /* MR_USE_MINIMAL_MODEL */
+
+#ifdef MR_HIGHLEVEL_CODE
+
+/*
+** We need to define stubs for these, even if MR_USE_MINIMAL_MODEL
+** is not enabled, since they are declared as `:- external', and
+** hence for profiling grades the generated code will take their
+** address to store in the label table.
+*/
+
+/* Declare them first, to avoid warnings from gcc -Wmissing-decls */
+void MR_CALL mercury__table_builtin__table_nondet_resume_1_p_0(
+ MR_C_Pointer subgoal_table_node, MR_C_Pointer *answer_block,
+ MR_Cont cont, void *cont_env_ptr);
+void MR_CALL mercury__table_builtin__table_nondet_suspend_2_p_0(
+ MR_C_Pointer subgoal_table_node);
+
+void MR_CALL
+mercury__table_builtin__table_nondet_resume_1_p_0(
+ MR_C_Pointer subgoal_table_node, MR_C_Pointer *answer_block,
+ MR_Cont cont, void *cont_env_ptr)
+{
+ MR_fatal_error("sorry, not implemented: "
+ "minimal model tabling with --high-level-code");
+}
+
+void MR_CALL
+mercury__table_builtin__table_nondet_suspend_2_p_0(
+ MR_C_Pointer subgoal_table_node)
+{
+ MR_fatal_error("sorry, not implemented: "
+ "minimal model tabling with --high-level-code");
+}
+
+#endif /* MR_HIGHLEVEL_CODE */
/* Ensure that the initialization code for the above modules gets to run. */
/*
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list