[m-rev.] for post-commit review: always compute self-import FIM langs

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Aug 18 14:28:43 AEST 2021



On Tue, 17 Aug 2021 12:00:30 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> On Mon, 16 Aug 2021 17:05:37 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote: 
> > On Sat, 14 Aug 2021, Zoltan Somogyi wrote: 
> > > For review by anyone. I am mostly seeking feedback about
> > > whether parse_tree_module_src should have TWO fields
> > > for self-import FIM languages: those languages for which
> > > the current module needs a self-import FIM in the interface
> > > section, and one likewise for the implementation section.
> > > My take is: yes, it should.
> > 
> > Agreed.
> 
> The attached diff implements this.

As it turns out, there was a reason why the original code
included implicit self-FIMs discovered in the implementation
section in the interface section of a module. Something
I did yesterday broke three test cases when doing a hlc
bootcheck, and I think it was this diff.

In all three test cases, the problem was that the C compiler
could not find MR_get_tabling_stats, and the reason for this
was that table_statistics.m did not have a self-FIM in the
interface. In the past, this self-FIM was added to interface
by the compiler, which, while inappropriate in general,
was by accident the right thing to do in this instance.

Fix the problem the right way by manually adding
a self-FIM to the interface of table_statistics.m,
and document the reason why this is an exceptional case.

Zoltan.

--- a/library/table_statistics.m
+++ b/library/table_statistics.m
@@ -154,6 +154,20 @@
 
 %---------------------------------------------------------------------------%
 
+:- implementation.
+:- interface.
+
+% The compiler, when implementing the "statistics" attribute of a
+% tabling pragma, can introduce calls to MR_get_tabling_stats.
+% This means that this C function is effectively part of the interface
+% of this module. However, this fact is an implementation detail
+% that is of concern only to implementors, which is why we do not
+% want it includes in the automaticallu generated documentation
+% of this module.
+:- pragma foreign_import_module("C", table_statistics).
+
+%---------------------------------------------------------------------------%
+
 :- implementation.
 
 :- import_module bool.





More information about the reviews mailing list