[m-rev.] diff: delete redundant uniqueness promises from compiler

Julien Fischer juliensf at csse.unimelb.edu.au
Mon May 7 16:58:24 AEST 2007


Estimated hours taken: 0.5
Branches: main

Remove redundant uniqueness promises from the compiler.  These have
been unnecessary since the globals field in the I/O state was made
non-unique.

compiler/globals.m:
compiler/handle_options.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/source_file_map.m:
 	Delete unnecessary uniqueness promises and the odd unique mode.

util/.cvsignore:
 	Unrelated change: ignore pad_backslash.

Julien.

Index: compiler/globals.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.82
diff -u -r1.82 globals.m
--- compiler/globals.m	7 May 2007 05:21:30 -0000	1.82
+++ compiler/globals.m	7 May 2007 06:35:41 -0000
@@ -140,10 +140,10 @@
  % Access predicates for the `globals' structure
  %

-:- pred globals_init(option_table::di, compilation_target::di, gc_method::di,
+:- pred globals_init(option_table::in, compilation_target::di, gc_method::di,
      tags_method::di, termination_norm::di, termination_norm::di,
      trace_level::di, trace_suppress_items::di,
-    may_be_thread_safe::di, globals::uo) is det.
+    may_be_thread_safe::di, globals::out) is det.

  :- pred get_options(globals::in, option_table::out) is det.
  :- pred get_target(globals::in, compilation_target::out) is det.
@@ -207,7 +207,7 @@
  % using io.set_globals and io.get_globals.
  %

-:- pred globals_io_init(option_table::di, compilation_target::in,
+:- pred globals_io_init(option_table::in, compilation_target::in,
      gc_method::in, tags_method::in, termination_norm::in,
      termination_norm::in, trace_level::in, trace_suppress_items::in,
      may_be_thread_safe::in, io::di, io::uo) is det.
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.298
diff -u -r1.298 handle_options.m
--- compiler/handle_options.m	7 May 2007 05:21:30 -0000	1.298
+++ compiler/handle_options.m	7 May 2007 06:35:41 -0000
@@ -152,8 +152,7 @@
              % XXX Currently smart recompilation doesn't check that all the
              % files needed to link are present and up-to-date, so disable it.
              globals.io_get_globals(Globals0, !IO),
-            disable_smart_recompilation("linking", Globals0, Globals1, !IO),
-            unsafe_promise_unique(Globals1, Globals),
+            disable_smart_recompilation("linking", Globals0, Globals, !IO),
              globals.io_set_globals(Globals, !IO)
          ;
              true
@@ -362,8 +361,7 @@
  postprocess_options_2(OptionTable0, Target, GC_Method, TagsMethod0,
          TermNorm, Term2Norm, TraceLevel, TraceSuppress, MaybeThreadSafe,
          !Errors, !IO) :-
-    unsafe_promise_unique(OptionTable0, OptionTable1), % XXX
-    globals_io_init(OptionTable1, Target, GC_Method, TagsMethod0,
+    globals_io_init(OptionTable0, Target, GC_Method, TagsMethod0,
          TermNorm, Term2Norm, TraceLevel, TraceSuppress, MaybeThreadSafe, !IO),

      some [!Globals] (
@@ -1917,8 +1915,6 @@
          ;
              HighLevel = yes
          ),
-
-        unsafe_promise_unique(!Globals),
          globals.io_set_globals(!.Globals, !IO)
      ).

Index: compiler/make.program_target.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.program_target.m,v
retrieving revision 1.70
diff -u -r1.70 make.program_target.m
--- compiler/make.program_target.m	7 May 2007 05:21:31 -0000	1.70
+++ compiler/make.program_target.m	7 May 2007 06:35:41 -0000
@@ -1034,7 +1034,7 @@
                      ), GradeSuccess, !IO)
              ), Cleanup, Succeeded, Info1, Info, !IO)
      ),
-    globals.io_set_globals(unsafe_promise_unique(OrigGlobals), !IO).
+    globals.io_set_globals(OrigGlobals, !IO).

  :- pred install_library_grade_2(bool::in, module_name::in,
      list(module_name)::in, make_info::in, bool::in, bool::out,
Index: compiler/make.util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.util.m,v
retrieving revision 1.45
diff -u -r1.45 make.util.m
--- compiler/make.util.m	2 May 2007 04:45:05 -0000	1.45
+++ compiler/make.util.m	7 May 2007 04:36:17 -0000
@@ -608,7 +608,7 @@
              OptionsErrors = [],
              Build(AllOptionArgs, Succeeded, Info0, Info, !IO),
              MaybeInfo = yes(Info),
-            globals.io_set_globals(unsafe_promise_unique(Globals), !IO)
+            globals.io_set_globals(Globals, !IO)
          )
      ).

Index: compiler/source_file_map.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/source_file_map.m,v
retrieving revision 1.22
diff -u -r1.22 source_file_map.m
--- compiler/source_file_map.m	3 Apr 2007 02:13:56 -0000	1.22
+++ compiler/source_file_map.m	7 May 2007 04:36:00 -0000
@@ -108,8 +108,7 @@
              SourceFileMap = map.init
          ),
          globals.io_get_globals(Globals1, !IO),
-        globals.set_source_file_map(yes(SourceFileMap), Globals1, Globals2),
-        unsafe_promise_unique(Globals2, Globals),
+        globals.set_source_file_map(yes(SourceFileMap), Globals1, Globals),
          globals.io_set_globals(Globals, !IO)
      ).

Index: util/.cvsignore
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/util/.cvsignore,v
retrieving revision 1.2
diff -u -r1.2 .cvsignore
--- util/.cvsignore	26 Oct 1998 04:01:20 -0000	1.2
+++ util/.cvsignore	7 May 2007 04:39:41 -0000
@@ -1,3 +1,4 @@
  mkinit
  mdemangle
  info_to_mdb
+pad_backslash

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