[m-dev.] diff: making minimal model programs link

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Jan 12 17:16:51 AEDT 2001


This change affects only code that is included in minimal model grades.
I will commit it on both branches.

runtime/mercury_tabling.c:
	Update the code in this file that implements predicates defined in
	library/table_builtin.m to reflect the movement of those predicates
	to library/table_builtin.m from library/private_builtin.m. Without
	these updates, you get link errors in minimal model grades.

Zoltan.

cvs diff: Diffing .
Index: mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.36
diff -u -b -r1.36 mercury_tabling.c
--- mercury_tabling.c	2000/12/21 03:42:49	1.36
+++ mercury_tabling.c	2001/01/12 04:15:27
@@ -1254,7 +1254,7 @@
 ** the parts of the stacks between the generator of B and the generator of A.
 */
 
-MR_declare_entry(mercury__table_nondet_resume_1_0);
+MR_declare_entry(mercury__table_builtin__table_nondet_resume_1_0);
 
 static void
 extend_consumer_stacks(MR_Subgoal *leader, MR_Consumer *suspension)
@@ -1378,7 +1378,7 @@
 #endif
 		} else {
 			*MR_redoip_addr(saved_fr) = (MR_Word)
-				MR_ENTRY(mercury__table_nondet_resume_1_0);
+				MR_ENTRY(mercury__table_builtin__table_nondet_resume_1_0);
 #ifdef	MR_TABLE_DEBUG
 			if (MR_tabledebug) {
 				printf("resume to redoip at %p (%d)\n",
@@ -1462,19 +1462,19 @@
 
 #ifndef MR_HIGHLEVEL_CODE
 
-MR_declare_entry(mercury__table_nondet_resume_1_0);
+MR_declare_entry(mercury__table_builtin__table_nondet_resume_1_0);
 MR_declare_entry(MR_do_trace_redo_fail);
 MR_declare_entry(MR_table_nondet_commit);
-MR_define_extern_entry(mercury__table_nondet_suspend_2_0);
-MR_MAKE_PROC_LAYOUT(mercury__table_nondet_suspend_2_0,
+MR_define_extern_entry(mercury__table_builtin__table_nondet_suspend_2_0);
+MR_MAKE_PROC_LAYOUT(mercury__table_builtin__table_nondet_suspend_2_0,
 	MR_DETISM_NON, 0, MR_LONG_LVAL_TYPE_UNKNOWN,
-	MR_PREDICATE, "private_builtin", "table_nondet_suspend", 2, 0);
+	MR_PREDICATE, "table_builtin", "table_nondet_suspend", 2, 0);
 MR_BEGIN_MODULE(table_nondet_suspend_module)
-	MR_init_entry_sl(mercury__table_nondet_suspend_2_0);
-	MR_INIT_PROC_LAYOUT_ADDR(mercury__table_nondet_suspend_2_0);
+	MR_init_entry_sl(mercury__table_builtin__table_nondet_suspend_2_0);
+	MR_INIT_PROC_LAYOUT_ADDR(mercury__table_builtin__table_nondet_suspend_2_0);
 MR_BEGIN_CODE
 
-MR_define_entry(mercury__table_nondet_suspend_2_0);
+MR_define_entry(mercury__table_builtin__table_nondet_suspend_2_0);
 {
 	MR_TrieNode	table;
 	MR_Subgoal	*subgoal;
@@ -1495,7 +1495,7 @@
 	** nondet stack fragment. The framevar slot is for use by
 	** table_nondet_resume.
 	*/
-	MR_mkframe("mercury__table_nondet_suspend", 1, MR_ENTRY(MR_do_fail));
+	MR_mkframe("mercury__table_builtin__table_nondet_suspend", 1, MR_ENTRY(MR_do_fail));
 
 	table = (MR_TrieNode) r1;
 	subgoal = table->MR_subgoal;
@@ -1536,7 +1536,7 @@
 
 				assert(MR_prevfr_slot(fr) == (stop_addr - 1));
 				*clobber_addr = (MR_Word)
-					MR_ENTRY(mercury__table_nondet_resume_1_0);
+					MR_ENTRY(mercury__table_builtin__table_nondet_resume_1_0);
 #ifdef	MR_TABLE_DEBUG
 				if (MR_tablestackdebug) {
 					printf("completing redoip "
@@ -1641,51 +1641,51 @@
 ** to it).
 */
 
-MR_define_extern_entry(mercury__table_nondet_resume_1_0);
-MR_declare_label(mercury__table_nondet_resume_1_0_ChangeLoop);
-MR_declare_label(mercury__table_nondet_resume_1_0_ReachedFixpoint);
-MR_declare_label(mercury__table_nondet_resume_1_0_LoopOverSuspensions);
-MR_declare_label(mercury__table_nondet_resume_1_0_ReturnAnswer);
-MR_declare_label(mercury__table_nondet_resume_1_0_RedoPoint);
+MR_define_extern_entry(mercury__table_builtin__table_nondet_resume_1_0);
+MR_declare_label(mercury__table_builtin__table_nondet_resume_1_0_ChangeLoop);
+MR_declare_label(mercury__table_builtin__table_nondet_resume_1_0_ReachedFixpoint);
+MR_declare_label(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions);
+MR_declare_label(mercury__table_builtin__table_nondet_resume_1_0_ReturnAnswer);
+MR_declare_label(mercury__table_builtin__table_nondet_resume_1_0_RedoPoint);
 
-MR_MAKE_PROC_LAYOUT(mercury__table_nondet_resume_1_0,
+MR_MAKE_PROC_LAYOUT(mercury__table_builtin__table_nondet_resume_1_0,
 	MR_DETISM_NON, MR_ENTRY_NO_SLOT_COUNT, MR_LONG_LVAL_TYPE_UNKNOWN,
-	MR_PREDICATE, "private_builtin", "table_nondet_resume", 1, 0);
+	MR_PREDICATE, "table_builtin", "table_nondet_resume", 1, 0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_ChangeLoop,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_ChangeLoop,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_ReachedFixpoint,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_ReachedFixpoint,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_LoopOverSubgoals,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_LoopOverSubgoals,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_LoopOverSuspensions,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_ReturnAnswer,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_ReturnAnswer,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_RedoPoint,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_RedoPoint,
+	mercury__table_builtin__table_nondet_resume_1_0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
-	mercury__table_nondet_resume_1_0_RestartPoint,
-	mercury__table_nondet_resume_1_0);
+	mercury__table_builtin__table_nondet_resume_1_0_RestartPoint,
+	mercury__table_builtin__table_nondet_resume_1_0);
 
 BEGIN_MODULE(table_nondet_resume_module)
-	MR_init_entry_sl(mercury__table_nondet_resume_1_0);
-	MR_INIT_PROC_LAYOUT_ADDR(mercury__table_nondet_resume_1_0);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_ChangeLoop);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_ReachedFixpoint);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_LoopOverSubgoals);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_LoopOverSuspensions);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_ReturnAnswer);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_RedoPoint);
-	MR_init_label_sl(mercury__table_nondet_resume_1_0_RestartPoint);
+	MR_init_entry_sl(mercury__table_builtin__table_nondet_resume_1_0);
+	MR_INIT_PROC_LAYOUT_ADDR(mercury__table_builtin__table_nondet_resume_1_0);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_ChangeLoop);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_ReachedFixpoint);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSubgoals);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_ReturnAnswer);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_RedoPoint);
+	MR_init_label_sl(mercury__table_builtin__table_nondet_resume_1_0_RestartPoint);
 BEGIN_CODE
 
-MR_define_entry(mercury__table_nondet_resume_1_0);
+MR_define_entry(mercury__table_builtin__table_nondet_resume_1_0);
 	MR_cur_leader = MR_top_generator_table();
 
 	if (MR_cur_leader->leader != NULL) {
@@ -1740,7 +1740,7 @@
 
 	MR_cur_leader->resume_info->changed = TRUE;
 
-MR_define_label(mercury__table_nondet_resume_1_0_ChangeLoop);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_ChangeLoop);
 
 	if (MR_cur_leader->resume_info->changed) {
 #ifdef	MR_TABLE_DEBUG
@@ -1775,13 +1775,13 @@
 		}
 #endif
 		MR_GOTO_LABEL(
-			mercury__table_nondet_resume_1_0_ReachedFixpoint);
+			mercury__table_builtin__table_nondet_resume_1_0_ReachedFixpoint);
 	}
 
 	MR_cur_leader->resume_info->subgoal_list = MR_cur_leader->followers;
 
 	/* For each of the subgoals on our list of followers */
-MR_define_label(mercury__table_nondet_resume_1_0_LoopOverSubgoals);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSubgoals);
 
 	if (MR_cur_leader->resume_info->subgoal_list == NULL) {
 #ifdef	MR_TABLE_DEBUG
@@ -1790,7 +1790,7 @@
 		}
 #endif
 
-		MR_GOTO_LABEL(mercury__table_nondet_resume_1_0_ChangeLoop);
+		MR_GOTO_LABEL(mercury__table_builtin__table_nondet_resume_1_0_ChangeLoop);
 	}
 
 	MR_cur_leader->resume_info->cur_subgoal =
@@ -1806,7 +1806,7 @@
 		MR_cur_leader->resume_info->cur_subgoal->num_ans;
 
 	/* For each of the suspended nodes for cur_subgoal */
-MR_define_label(mercury__table_nondet_resume_1_0_LoopOverSuspensions);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions);
 
 	if (MR_cur_leader->resume_info->consumer_list == NULL) {
 #ifdef	MR_TABLE_DEBUG
@@ -1815,7 +1815,7 @@
 		}
 #endif
 		MR_GOTO_LABEL(
-			mercury__table_nondet_resume_1_0_LoopOverSubgoals);
+			mercury__table_builtin__table_nondet_resume_1_0_LoopOverSubgoals);
 	}
 
 	MR_cur_leader->resume_info->cur_consumer =
@@ -1834,7 +1834,7 @@
 		}
 #endif
 		MR_GOTO_LABEL(
-			mercury__table_nondet_resume_1_0_LoopOverSuspensions);
+			mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions);
 	}
 
 #ifdef	MR_TABLE_DEBUG
@@ -1857,11 +1857,11 @@
 
 	MR_gen_next = MR_cur_leader->resume_info->leader_state.gen_next;
 	MR_redoip_slot(MR_maxfr) =
-		MR_LABEL(mercury__table_nondet_resume_1_0_RedoPoint);
+		MR_LABEL(mercury__table_builtin__table_nondet_resume_1_0_RedoPoint);
 	MR_redofr_slot(MR_maxfr) = MR_maxfr;
 	MR_based_framevar(MR_maxfr, 1) = (MR_Word) MR_cur_leader;
 
-MR_define_label(mercury__table_nondet_resume_1_0_ReturnAnswer);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_ReturnAnswer);
 
 	/*
 	** Return the next answer in MR_cur_leader->resume_info->
@@ -1889,8 +1889,8 @@
 	*/
 	MR_succeed();
 
-MR_define_label(mercury__table_nondet_resume_1_0_RedoPoint);
-	MR_update_prof_current_proc(MR_LABEL(mercury__table_nondet_resume_1_0));
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_RedoPoint);
+	MR_update_prof_current_proc(MR_LABEL(mercury__table_builtin__table_nondet_resume_1_0));
 
 	/*
 	** This is where the current consumer suspension will go on
@@ -1902,7 +1902,7 @@
 
 	MR_cur_leader = (MR_Subgoal *) MR_based_framevar(MR_maxfr, 1);
 
-MR_define_label(mercury__table_nondet_resume_1_0_RestartPoint);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_RestartPoint);
 #ifdef	MR_TABLE_DEBUG
 	if (MR_tabledebug) {
 		printf("cur_consumer_answer_list: %p\n",
@@ -1914,7 +1914,7 @@
 #endif
 
 	if (MR_cur_leader->resume_info->cur_consumer_answer_list != NULL) {
-		MR_GOTO_LABEL(mercury__table_nondet_resume_1_0_ReturnAnswer);
+		MR_GOTO_LABEL(mercury__table_builtin__table_nondet_resume_1_0_ReturnAnswer);
 	}
 
 #ifdef	MR_TABLE_DEBUG
@@ -1929,9 +1929,9 @@
 		MR_cur_leader->resume_info->changed = TRUE;
 	}
 
-	MR_GOTO_LABEL(mercury__table_nondet_resume_1_0_LoopOverSuspensions);
+	MR_GOTO_LABEL(mercury__table_builtin__table_nondet_resume_1_0_LoopOverSuspensions);
 
-MR_define_label(mercury__table_nondet_resume_1_0_ReachedFixpoint);
+MR_define_label(mercury__table_builtin__table_nondet_resume_1_0_ReachedFixpoint);
 	{
 		MR_SubgoalList	table_list;
 
cvs diff: Diffing GETOPT
cvs diff: Diffing machdeps
--------------------------------------------------------------------------
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