[m-rev.] diff: workaround a problem with extraenous .int0 files

Julien Fischer juliensf at cs.mu.OZ.AU
Mon May 2 14:30:27 AEST 2005


Estimated hours taken: 0.5
Branches: main, release

Workaround a problem where the compiler generates private
interfaces for nested submodules even if the submodules
themselves, have no children.  This is currently a bit
of an annoyance because realclean won't delete these
extraneous .int0 files.  mmc --make also generates these
extra .int0 files except that it does clean them up.

compiler/modules.m:
	Make sure that any extra .int0 files that are
	being erroneously created are also cleaned up.
	(I've left the correct code in, commented out with
	a note to say that it should be uncommented when this
	is fixed).

	Fix a couple of typos.
Julien.

Workspace:/home/jupiter/juliensf/ws74
Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.327
diff -u -r1.327 modules.m
--- modules.m	20 Apr 2005 12:57:13 -0000	1.327
+++ modules.m	2 May 2005 04:17:21 -0000
@@ -2382,7 +2382,7 @@
         Items0, PublicChildren, NestedChildren, FactDeps,
         MaybeTimestamps, !:Module),

-        % If this module has any seperately-compiled sub-modules,
+        % If this module has any separately-compiled sub-modules,
         % then we need to make everything in the implementation
         % of this module exported_to_submodules.  We do that by
         % splitting out the implementation declarations and putting
@@ -4837,14 +4837,33 @@
     io__write_string(DepStream, "\n", !IO),

     % `.int0' files are only generated for modules with sub-modules.
-    ModulesWithSubModules = list__filter(
-        (pred(Module::in) is semidet :-
-            map__lookup(DepsMap, Module, deps(_, ModuleImports)),
-            ModuleImports ^ children = [_ | _]
-        ), Modules),
+    %
+    % XXX The dependencies for nested submodules are wrong - we
+    % currently end up generating .int0 files for nested submodules that
+    % don't have any children (the correct thing is done for separate
+    % submodules).  The following commented out code generates the
+    % correct rules for .int0 files; it and the line below can be
+    % uncommented when the dependency problem is fixed.
+    %
+    % ModulesWithSubModules = list__filter(
+    %   (pred(Module::in) is semidet :-
+    %       map__lookup(DepsMap, Module, deps(_, ModuleImports)),
+    %       ModuleImports ^ children = [_ | _]
+    %   ), Modules),
     io__write_string(DepStream, MakeVarName, !IO),
     io__write_string(DepStream, ".int0s = ", !IO),
-    write_dependencies_list(ModulesWithSubModules, ".int0", DepStream, !IO),
+    %
+    % These next two lines are a workaround for the bug described above.
+    %
+    write_compact_dependencies_list(Modules, "$(ints_subdir)", ".int0",
+        Basis, DepStream, !IO),
+    write_compact_dependencies_separator(Basis, DepStream, !IO),
+    %
+    % End of workaround - it can be deleted when the bug described above
+    % is fixed.  When that happens the following line needs to be
+    % uncommented.
+    %
+    %write_dependencies_list(ModulesWithSubModules, ".int0", DepStream, !IO),
     io__write_string(DepStream, "\n", !IO),

     io__write_string(DepStream, MakeVarName, !IO),
@@ -7635,6 +7654,7 @@
 %-----------------------------------------------------------------------------%
 %
 % Java command-line utilities.
+%

 create_java_shell_script(MainModuleName, Succeeded, !IO) :-
     % XXX Extension should be ".bat" on Windows

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