[m-rev.] trivial diff: reformat code that constructs linker cmd line

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 29 14:39:31 AEDT 2008


Estimated hours taken: 0.1
Branches: main

compiler/compile_target_code.m:
 	Reformat the code used to construct the command line used to invoke
 	the linker so that it is easier to modify and easier to see where
 	spaces between options have accidently been omitted.

Julien.


Index: compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.127
diff -u -r1.127 compile_target_code.m
--- compile_target_code.m	29 Jan 2008 01:05:39 -0000	1.127
+++ compile_target_code.m	29 Jan 2008 03:37:27 -0000
@@ -1727,7 +1727,7 @@
              RpathDirs = [],
              RpathOpts = ""
          ;
-            RpathDirs = [_|_],
+            RpathDirs = [_ | _],
              globals.io_lookup_string_option(RpathSepOpt, RpathSep, !IO),
              globals.io_lookup_string_option(RpathFlagOpt, RpathFlag, !IO),
              RpathOpts0 = string.join_list(RpathSep, RpathDirs),
@@ -1790,16 +1790,24 @@
          % Note that LDFlags may contain `-l' options so it should come
          % after Objects.
          globals.io_lookup_string_option(CommandOpt, Command, !IO),
-        string.append_list(
-            [Command, " ",
-            StaticOpts, " ", StripOpt, " ", UndefOpt, " ",
-            ThreadOpts, " ", TraceOpts, " ",
-            " -o ", OutputFileName, " ", Objects, " ",
-            LinkOptSep, " ", LinkLibraryDirectories, " ",
-            RpathOpts, " ", InstallNameOpt, " ", DebugOpts,
-            " ", LDFlags, " ", LinkLibraries, " ",
-            MercuryStdLibs, " ", SystemLibs],
-            LinkCmd),
+        string.append_list([
+                Command, " ",
+                StaticOpts, " ",
+                StripOpt, " ",
+                UndefOpt, " ",
+                ThreadOpts, " ",
+                TraceOpts, " ",
+                " -o ", OutputFileName, " ",
+                Objects, " ",
+                LinkOptSep, " ",
+                LinkLibraryDirectories, " ",
+                RpathOpts, " ",
+                InstallNameOpt, " ",
+                DebugOpts, " ",
+                LDFlags, " ",
+                LinkLibraries, " ",
+                MercuryStdLibs, " ",
+                SystemLibs], LinkCmd),

          globals.io_lookup_bool_option(demangle, Demangle, !IO),
          (

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