[m-rev.] diff: re-enable exceptions in the .NET backend

Tyson Dowd trd at miscrit.be
Tue Sep 18 23:02:51 AEST 2001


Hi,

Lots of changes requiring bootstrapping have been committed lately, 
this one was fixed before them so it shouldn't cause any more
problems.

===================================================================


Estimated hours taken: 0.3
Branches: main

library/exception.m:
	Re-enable the mode-specific clauses for catch_imp and
	throw_impl, the compiler bug that caused a problem compiling
	this has been fixed for a while now.
	This change makes exceptions work again for the .NET backend.
	[sound of raucous cheering]
	


Index: library/exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.53
diff -u -r1.53 exception.m
--- library/exception.m	2001/09/02 12:20:11	1.53
+++ library/exception.m	2001/09/11 12:10:34
@@ -604,9 +604,7 @@
 % unsorted_solutions/2), and Mercury does not (yet?) support
 % impure higher-order pred terms.
 %
-% XXX no promise_pure for now, as the multiple modes are disabled
-% due to a bug in intermodule optimization.
-%:- pragma promise_pure(catch_impl/3).
+:- pragma promise_pure(catch_impl/3).
 :- /* impure */
    pred catch_impl(pred(T), handler(T), T).
 :- mode catch_impl(pred(out) is det,       in(handler), out) is det.
@@ -622,23 +620,19 @@
 throw_impl(Univ::in) :-
 	builtin_throw(Univ).
 
-catch_impl(Pred, Handler, T) :-
-	builtin_catch(Pred, Handler, T).
 
-% XXX the multiple modes are disabled due to a bug in intermodule optimization.
-%
-%catch_impl(Pred::(pred(out) is det), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
-%catch_impl(Pred::(pred(out) is semidet), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
-%catch_impl(Pred::(pred(out) is cc_multi), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
-%catch_impl(Pred::(pred(out) is cc_nondet), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
-%catch_impl(Pred::(pred(out) is multi), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
-%catch_impl(Pred::(pred(out) is nondet), Handler::in(handler), T::out) :-
-%	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is det), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is semidet), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is cc_multi), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is cc_nondet), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is multi), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
+catch_impl(Pred::(pred(out) is nondet), Handler::in(handler), T::out) :-
+	builtin_catch(Pred, Handler, T).
 
 % builtin_throw and builtin_catch are implemented below using
 % hand-coded low-level C code.
@@ -1107,12 +1101,7 @@
 
 	% For the .NET backend we override throw_impl as it is easier to 
 	% implement these things using foreign_proc.
-	%
-	% XXX disabled for now due to a bug in intermodule optimization
-	% that stops the mode specific clauses for throw_impl from being
-	% used.
 
-/*
 :- pragma foreign_proc("C#", throw_impl(T::in), [will_not_call_mercury], "
 	throw new mercury.runtime.Exception(T);
 ").
@@ -1142,6 +1131,7 @@
 			TypeInfo_for_T, Handler, ex.mercury_exception, ref T);
 	}
 ").
+/*
 
 	% We can't implement these until we implement semidet procedures 
 	% for the C# interface.

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