[m-rev.] for review: improvements for foreign_type
Simon Taylor
stayl at cs.mu.OZ.AU
Fri Jun 28 23:14:13 AEST 2002
On 28-Jun-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> Here is the review of make_hlds.m
>
> On Fri, Jun 28, 2002 at 06:30:46PM +1000, Simon Taylor wrote:
> > Index: compiler/make_hlds.m
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
> > retrieving revision 1.414
> > diff -u -u -r1.414 make_hlds.m
> > --- compiler/make_hlds.m 10 Jun 2002 15:58:05 -0000 1.414
> > +++ compiler/make_hlds.m 26 Jun 2002 18:22:31 -0000
> > @@ -2024,20 +2035,76 @@
> > )
> > ).
> >
> > +:- pred check_foreign_type_visibility(import_status::in,
> > + import_status::in) is semidet.
> > +
> > +check_foreign_type_visibility(OldStatus, NewStatus) :-
> > + ( OldStatus = abstract_exported ->
> > + status_is_exported_to_non_submodules(NewStatus, no)
>
> Shouldn't that be a yes? If the old status is abstract_exported then the
> new status should also be exported.
No. I've added a comment:
--- make_hlds.m 2002/06/28 13:08:41 1.1
+++ make_hlds.m 2002/06/28 13:10:32
@@ -2035,17 +2035,23 @@
)
).
+ % check_foreign_type_visibility(OldStatus, NewDefnStatus).
+ %
+ % Check that the visibility of the new definition for
+ % a foreign type matches that of previous definitions.
:- pred check_foreign_type_visibility(import_status::in,
import_status::in) is semidet.
-check_foreign_type_visibility(OldStatus, NewStatus) :-
+check_foreign_type_visibility(OldStatus, NewDefnStatus) :-
( OldStatus = abstract_exported ->
- status_is_exported_to_non_submodules(NewStatus, no)
+ % If OldStatus is abstract_exported, the previous
+ % definitions were local.
+ status_is_exported_to_non_submodules(NewDefnStatus, no)
; OldStatus = exported ->
- NewStatus = exported
+ NewDefnStatus = exported
;
status_is_exported_to_non_submodules(OldStatus, no),
- status_is_exported_to_non_submodules(NewStatus, no)
+ status_is_exported_to_non_submodules(NewDefnStatus, no)
).
% Add the constructors and special preds for a type to the HLDS.
--------------------------------------------------------------------------
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