[m-rev.] diff/for review: fix library compilation error in non-C grades

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Dec 16 17:29:00 AEDT 2004


On Thu, 16 Dec 2004, Julien Fischer wrote:

>
> Estimated hours taken: 0.2
> Branches: main
>
> Fix some compilation errors for the library in the non-C grades.
>
> library/robdd.m:
> 	Comment out the memoing pragmas until we have an
> 	option to ignore them in unsupported grades.  Those
> 	affected can uncomment them in their workspaces for
> 	the moment.
>

I've taken this bit out as Zoltan is fixing this.  There
is also another problem with the java grade and pseudo_type_descs;
I've added a workaround which is sufficient to get the library
compile in grade java.

Note: The library won't compile in grade java until the changes
Zoltan made to the library today have bootstrapped overnight.
(I think this probably only affects jupiter).

Modified log message and diff follow:


Estimated hours taken: 1.5
Branches: main

Fix some compilation errors for the library in the non-C grades.

Provide a workaround for a problem with the library in the java
grade.

library/rtti_implementation.m:
	s/get_functor_2/get_functor_with_names/ since that is
	how it is referred to in the calls from the construct
	module.

library/type_desc.m:
	Import std_util since semidet_fail is now used in this
	module.

	Provide a foreign type definition for pseudo_type_desc.
	XXX This is not correct but something is amiss with
	either the Java backend and/or the Java runtime.  Providing
	a foreign type means that the library will at least compile.

Index: rtti_implementation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/rtti_implementation.m,v
retrieving revision 1.55
diff -u -r1.55 rtti_implementation.m
--- rtti_implementation.m	14 Dec 2004 01:07:20 -0000	1.55
+++ rtti_implementation.m	16 Dec 2004 03:19:07 -0000
@@ -85,8 +85,9 @@
 :- pred get_functor(type_desc__type_desc::in, int::in, string::out, int::out,
 	list(type_desc__type_desc)::out) is semidet.

-:- pred get_functor_2(type_desc__type_desc::in, int::in, string::out, int::out,
-	list(type_desc__type_desc)::out, list(string)::out) is semidet.
+:- pred get_functor_with_names(type_desc__type_desc::in, int::in, string::out,
+	int::out, list(type_desc__type_desc)::out, list(string)::out)
+	is semidet.

 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
@@ -316,8 +317,8 @@
 	get_functor_impl(TypeDesc, FunctorNumber, FunctorName, Arity,
 		TypeInfoList, _Names).

-get_functor_2(TypeDesc, FunctorNumber, FunctorName, Arity, TypeInfoList,
-		Names) :-
+get_functor_with_names(TypeDesc, FunctorNumber, FunctorName, Arity,
+		TypeInfoList, Names) :-
 	get_functor_impl(TypeDesc, FunctorNumber, FunctorName, Arity,
 		TypeInfoList, Names).

Index: type_desc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/type_desc.m,v
retrieving revision 1.28
diff -u -r1.28 type_desc.m
--- type_desc.m	14 Dec 2004 01:07:21 -0000	1.28
+++ type_desc.m	16 Dec 2004 05:39:04 -0000
@@ -210,6 +210,7 @@

 :- import_module bool, string, require.
 :- use_module    rtti_implementation.
+:- use_module	 std_util.

 :- pragma foreign_decl("C", "
 #include ""mercury_heap.h""	/* for MR_incr_hp_msg() etc. */
@@ -334,7 +335,7 @@
 is_univ_pseudo_type_desc(_PseudoTypeDesc, -1) :-
 	% The backends in which we use this definition of this predicate
 	% don't yet support pseudo_type_descs.
-	semidet_fail.
+	std_util.semidet_fail.

 :- pred is_exist_pseudo_type_desc(pseudo_type_desc::in, int::out) is semidet.

@@ -358,7 +359,7 @@
 is_exist_pseudo_type_desc(_PseudoTypeDesc, -1) :-
 	% The backends in which we use this definition of this predicate
 	% don't yet support pseudo_type_descs.
-	semidet_fail.
+	std_util.semidet_fail.

 :- pragma foreign_proc("C",
 	type_desc_to_pseudo_type_desc(TypeDesc::in) = (PseudoTypeDesc::out),
@@ -790,6 +791,11 @@
 	TypeDesc = type_of(Type).

 %-----------------------------------------------------------------------------%
+
+	% XXX This is just here so that the library compiles in grade java.
+	% pseudo_type_desc's have not been implemented for the Java backend
+	% yet.
+:- pragma foreign_type("Java", pseudo_type_desc, "java.lang.Object").

 :- pragma foreign_code("Java", "
 	public static class Type_desc_0 {
--------------------------------------------------------------------------
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