[m-rev.] for review: fix .NET commit handling
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Jul 11 22:48:37 AEST 2001
On 11-Jul-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> compiler/mlds_to_il.m:
> Fix rval_to_type to correct get the type from var references, and
> handle box/unbox and cast unops.
Is this change related to the commit stuff?
> Index: compiler/mlds_to_il.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
> retrieving revision 1.42
> diff -u -r1.42 mlds_to_il.m
> --- compiler/mlds_to_il.m 2001/07/11 10:24:36 1.42
> +++ compiler/mlds_to_il.m 2001/07/11 12:21:52
> +rval_to_type(unop(Unop, _), Type) :-
> + (
> + Unop = box(_),
> + Type = mlds__generic_type
> + ;
> + Unop = unbox(UnboxType),
> + Type = UnboxType
> + ;
> + Unop = cast(CastType),
> + Type = CastType
> + ;
> + Unop = std_unop(StdUnop),
> + functor(StdUnop, StdUnopStr, _Arity),
> + unexpected(this_file, "rval_to_type: unop: " ++ StdUnopStr)
Shouldn't that call "sorry" rather than "unexpected"?
The difference between the two is that "sorry" indicates that the code
in this module is incomplete, whereas "unexpected" indicates that there
must be a bug in some earlier stage of the compiler.
> +rval_to_type(binop(_, _, _), _) :-
> + unexpected(this_file, "rval_to_type: binop").
> +
> +rval_to_type(mem_addr(_), _) :-
> + unexpected(this_file, "rval_to_type: mem_addr").
Likewise here.
> +rval_to_type(self(_), Type) :-
> ModuleName = mercury_module_name_to_mlds(unqualified("mercury")),
> Type = mlds__class_type(qual(ModuleName, "invalid"),
> 0, mlds__class).
Shouldn't that be
rval_to_type(self(Type), Type).
?
Also, you're changing failures here from link-time failures to compile-time
failures. Does the library still compile with this change?
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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