[m-rev.] diff: add --output-libgrades

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Aug 8 19:02:49 AEST 2006


Estimated hours taken: 1
Branches: main

Add a new output option `--output-libgrades' that prints the list of grades
that the compiler will build libraries that are to be installed in.  This is
useful for debugging problems Mercury.options files (and for Mercury
developers, problems with mmc --make.)

compiler/options.m:
compiler/mercury_compile.m:
 	Implement the new option.

doc/user_guide.texi:
 	Document the new option.

Julien.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.395
diff -u -r1.395 mercury_compile.m
--- compiler/mercury_compile.m	28 Jul 2006 04:54:02 -0000	1.395
+++ compiler/mercury_compile.m	8 Aug 2006 08:52:52 -0000
@@ -372,6 +372,8 @@
          OutputShLibLinkCommand),
      globals.lookup_bool_option(Globals, filenames_from_stdin,
          FileNamesFromStdin),
+    globals.lookup_bool_option(Globals, output_libgrades,
+        OutputLibGrades),
      globals.lookup_bool_option(Globals, make, Make),
      ( Version = yes ->
          io.stdout_stream(Stdout, !IO),
@@ -403,6 +405,10 @@
          io.stdout_stream(Stdout, !IO),
          io.write_string(Stdout, LinkCommand, !IO),
          io.write_string(Stdout, "\n", !IO)
+    ; OutputLibGrades = yes ->
+        globals.lookup_accumulating_option(Globals, libgrades, LibGrades),
+        io.stdout_stream(Stdout, !IO),
+        io.write_list(Stdout, LibGrades, "\n", io.write_string, !IO)
      ; GenerateMapping = yes ->
          source_file_map.write_source_file_map(Args, !IO)
      ; Make = yes ->
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.521
diff -u -r1.521 options.m
--- compiler/options.m	8 Aug 2006 08:26:25 -0000	1.521
+++ compiler/options.m	8 Aug 2006 09:00:05 -0000
@@ -168,6 +168,7 @@
      ;       output_grade_string
      ;       output_link_command
      ;       output_shared_lib_link_command
+    ;       output_libgrades

      % Auxiliary output options
      ;       smart_recompilation
@@ -921,7 +922,8 @@
      compile_to_shared_lib               -   bool(no),
      output_grade_string                 -   bool(no),
      output_link_command                 -   bool(no),
-    output_shared_lib_link_command      -   bool(no)
+    output_shared_lib_link_command      -   bool(no),
+    output_libgrades                    -   bool(no)

  ]).
  option_defaults_2(aux_output_option, [
@@ -1640,6 +1642,7 @@
  long_option("output-grade-string",  output_grade_string).
  long_option("output-link-command",  output_link_command).
  long_option("output-shared-lib-link-command", output_shared_lib_link_command).
+long_option("output-libgrades", output_libgrades).

  % aux output options
  long_option("smart-recompilation",  smart_recompilation).
@@ -3019,7 +3022,10 @@
          "\tstandard output.",
          "--output-shared-lib-link-command",
          "\tPrint the command used to link shared libraries to the",
-        "\tstandard output."
+        "\tstandard output.",
+        "--output-libgrades",
+        "\tPrint the list of compilation grades in which a library",
+        "\tto be installed should be built to the standard output."
      ]).

  :- pred options_help_aux_output(io::di, io::uo) is det.
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.484
diff -u -r1.484 user_guide.texi
--- doc/user_guide.texi	25 Jul 2006 06:58:35 -0000	1.484
+++ doc/user_guide.texi	8 Aug 2006 08:59:45 -0000
@@ -5727,6 +5727,13 @@
  @findex --output-shared-lib-link-command
  Print the command used to link shared libraries to the
  standard output.
+
+ at sp 1
+ at item --output-libgrades
+ at findex --output-libgrades
+Print the list of compilation grades in which a library to
+be installed should be built to the standard output.
+
  @end table

  @node Auxiliary output options

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