[m-dev.] for review: fix HLC profiling link errors

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Dec 16 08:39:12 AEDT 2000


Estimated hours taken: 0.75

Fix a problem with undefined symbols in the hl*prof* grades.
This was precipitated by my recent change to the handling
of `:- external' for the MLDS back-end.  As a result of that
change, the compiler now reports link errors in hl*prof* grades
if there were any symbols declared as `:- external' and not
defined.

runtime/mercury_tabling.c:
	Add stub definitions of table_suspend and table_resume
	for the --high-level-code grades; currently these
	just call error/1.

library/private_builtin.m:
	Delete the `:- external' declaration for the builtin
	procedures `builtin_int_lt' and `builtin_int_gt'.
	That was needed for boostrapping a few years ago
	but is no longer necessary.

library/private_builtin.m:
	Provide a definition of free_heap, to avoid link errors
	in hl*prof* grades.

Workspace: /home/pgrad/fjh/ws/hg
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.58
diff -u -d -r1.58 private_builtin.m
--- library/private_builtin.m	2000/11/23 02:00:01	1.58
+++ library/private_builtin.m	2000/12/15 21:31:48
@@ -40,7 +40,6 @@
 	% mode_util__recompute_instmap_delta.
 :- pred free_heap(_T).
 :- mode free_heap(di) is det.
-:- external(free_heap/1).
 
 %-----------------------------------------------------------------------------%
 
@@ -90,13 +89,11 @@
 	% for compare/3 preds.
 :- pred builtin_int_lt(int, int).
 :- mode builtin_int_lt(in, in) is semidet.
-:- external(builtin_int_lt/2).
 
 	% The builtin > operator on ints, used in the code generated
 	% for compare/3 preds.
 :- pred builtin_int_gt(int, int).
 :- mode builtin_int_gt(in, in) is semidet.
-:- external(builtin_int_gt/2).
 
 	% A "typed" version of unify/2 -- i.e. one that can handle arguments
 	% of different types.  It first unifies their types, and then if
@@ -121,6 +118,10 @@
 :- pragma inline(builtin_compare_character/3).
 :- pragma inline(builtin_compare_string/3).
 :- pragma inline(builtin_compare_float/3).
+
+:- pragma c_code(free_heap(Val::di),
+	[will_not_call_mercury, thread_safe],
+	"MR_free_heap((void *) Val);").
 
 builtin_unify_int(X, X).
 
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.34
diff -u -d -r1.34 mercury_tabling.c
--- runtime/mercury_tabling.c	2000/12/04 18:28:40	1.34
+++ runtime/mercury_tabling.c	2000/12/15 21:29:45
@@ -1460,6 +1460,27 @@
 ** 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 */
+
 MR_declare_entry(mercury__table_nondet_resume_1_0);
 MR_declare_entry(MR_do_trace_redo_fail);
 MR_declare_entry(MR_table_nondet_commit);
@@ -1971,6 +1992,8 @@
 	MR_commit_cut();
 	MR_fail();
 END_MODULE
+
+#endif /* ! MR_HIGHLEVEL_CODE */
 
 #endif	/* MR_USE_MINIMAL_MODEL */
 

-- 
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