[m-rev.] diff: fix bootstrapping problem

Julien Fischer juliensf at csse.unimelb.edu.au
Thu May 31 00:15:29 AEST 2007


Estimated hours taken: 1
Branches: main

Fix a problem that prevented the compiler bootstrapping.

compiler/term_constr_initial.m:
compiler/termination.m:
 	Conform to the new behaviour of status_defined_in_this_module/1
 	w.r.t procedures defined by `:- external'.

 	Change the progress message emitted during termination analysis
 	to say that we are `Checking the termination of' a procedure
 	rather than just `Checking' it.

Julien.

Index: compiler/term_constr_initial.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_constr_initial.m,v
retrieving revision 1.18
diff -u -r1.18 term_constr_initial.m
--- compiler/term_constr_initial.m	17 May 2007 03:52:52 -0000	1.18
+++ compiler/term_constr_initial.m	30 May 2007 14:08:20 -0000
@@ -290,7 +290,10 @@
          ->
              true
          ;
-            status_defined_in_this_module(ImportStatus) = yes
+            % Since we cannot see the definition we consider procedures
+            % defined using `:- external' to be imported.
+            status_defined_in_this_module(ImportStatus) = yes,
+            ImportStatus \= status_external(_)
          ->
              % XXX At the moment if a procedure has a pragma terminates
              % declaration its argument size information is set to true.
Index: compiler/termination.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.74
diff -u -r1.74 termination.m
--- compiler/termination.m	17 May 2007 03:52:53 -0000	1.74
+++ compiler/termination.m	30 May 2007 14:08:20 -0000
@@ -586,7 +586,7 @@

  check_preds([], !ModuleInfo, !IO).
  check_preds([PredId | PredIds], !ModuleInfo, !IO) :-
-    write_pred_progress_message("% Checking ", PredId, !.ModuleInfo, !IO),
+    write_pred_progress_message("% Checking termination of ", PredId, !.ModuleInfo, !IO),
      globals.io_lookup_bool_option(make_optimization_interface, MakeOptInt, !IO),
      module_info_preds(!.ModuleInfo, PredTable0),
      map.lookup(PredTable0, PredId, PredInfo0),
@@ -604,8 +604,11 @@
      ->
          ProcTable2 = ProcTable1
      ;
-        status_defined_in_this_module(ImportStatus) = yes
+        status_defined_in_this_module(ImportStatus) = yes,
+        ImportStatus \= status_external(_)
      ->
+        % Since we cannot see the definition we consider procedures
+        % defined using `:- external' to be imported.
          ( check_marker(Markers, marker_terminates) ->
              change_procs_termination_info(ProcIds, yes, cannot_loop(unit),
                  ProcTable0, ProcTable2)



--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list