[m-dev.] for review: add opt_exported import_status

Peter Ross peter.ross at miscrit.be
Mon Mar 5 20:56:06 AEDT 2001


On Fri, Mar 02, 2001 at 11:30:50PM +1100, Simon Taylor wrote:
> On Fri, Mar 02, 2001 at 10:29:32AM +0100, Peter Ross wrote:
> > On Thu, Mar 01, 2001 at 01:06:41PM +0100, Peter Ross wrote:
> > > On Wed, Feb 28, 2001 at 11:16:47AM +0100, Peter Ross wrote:
> > > > Hi,
> > > > 
> > > > For stayl to review.
> > > > 
> > > > I have only one issue with this change and that is the test
> > > > term/associative.m now fails because it no longer contains a
> > > > termination_info pragma about rewrite.  However rewrite only exists in
> > > > the implementation section, so should we have been outputting a
> > > > termination_info pragma in the first place?
> > > > 
> > > If possible, I would like to check this in tomorrow.  Will there be
> > > anymore review comments?
> > > 
> > I will check this in later today, with the following additional patch to
> > the tests directory if there are no objections.
> 
> I'm pretty sure your change does the wrong thing for termination
> pragmas. Termination information for opt_exported predicates should
> be written to the `.opt' files, as you've done for unused arguments
> pragmas.
> 
Put that fix in, here is the new log message and relative diff.


Estimated hours taken: 1
Branches: main

Merge changes from the reuse branch to the main branch.
This change introduces a new import_status opt_exported.
A local predicate which appeared in a .opt file (even if it was only a
call to that predicate) needs to have its export status changed to
exported so that an entry point to that predicate is available.  This
can confuse the structure reuse analysis, so we added the new
import_status: opt_exported.

compiler/hlds_pred.m:
    Add opt_exported to the import_status, and adapt the predicates
    corresponding predicates.

compiler/intermod.m:
    When the status of a local predicate is changed due to its presence
    in the .opt file, this status is now set to opt_exported instead of
    exported.
    
compiler/unused_args.m:
    When we check for pred_info_is_exported, also check for
    pred_info_is_opt_exported.

compiler/termination.m:
    Write out termination info pragmas for opt_exported procedures.

compiler/assertion.m:
compiler/hlds_out.m:
    Minor changes.

diff -u compiler/assertion.m compiler/assertion.m
--- compiler/assertion.m
+++ compiler/assertion.m
@@ -838,7 +838,7 @@
 is_defined_in_implementation_section(abstract_imported, no).
 is_defined_in_implementation_section(pseudo_imported, no).
 is_defined_in_implementation_section(exported, no).
-is_defined_in_implementation_section(opt_exported, no).
+is_defined_in_implementation_section(opt_exported, yes).
 is_defined_in_implementation_section(pseudo_exported, no).
 
 %-----------------------------------------------------------------------------%
only in patch2:
--- compiler/termination.m	2001/01/17 01:42:11	1.22
+++ compiler/termination.m	2001/03/05 09:51:07
@@ -698,7 +698,11 @@
 	{ TypeSpecInfo = type_spec_info(_, TypeSpecForcePreds, _, _) },
 
 	( 
-		{ ImportStatus = exported },
+		{
+			ImportStatus = exported
+		;
+			ImportStatus = opt_exported
+		},
 		{ \+ code_util__compiler_generated(PredInfo) },
 
 		% XXX These should be allowed, but the predicate
--------------------------------------------------------------------------
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