diff: get mmc to pass --trace to ml

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Mar 28 17:19:25 AEST 1999


Estimated hours taken: 0.25

compiler/mercury_compile.m:
	If tracing was enabled, pass `--trace' to the Mercury linker.
	This change lets you use the command `mmc --trace deep foo.m'
	rather than having to use the more ugly and complicated
	command `mmc --trace deep --link-flags "--trace" foo.m'.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.120
diff -u -r1.120 mercury_compile.m
--- mercury_compile.m	1999/03/22 08:07:28	1.120
+++ mercury_compile.m	1999/03/28 07:08:40
@@ -2444,14 +2444,15 @@
 	;
 	    % create the initialization C file
 	    maybe_write_string(Verbose, "% Creating initialization file...\n"),
-	    join_module_list(Modules, ".m", ["> ", InitCFileName], MkInitCmd0),
 	    globals__io_get_trace_level(TraceLevel),
 	    { TraceLevel \= none ->
-		CmdPrefix = "c2init -t "
+		TraceOpt = "--trace "
 	    ;
-		CmdPrefix = "c2init "
+		TraceOpt = ""
 	    },
-	    { string__append_list([CmdPrefix | MkInitCmd0], MkInitCmd) },
+	    join_module_list(Modules, ".m", ["> ", InitCFileName], MkInitCmd0),
+	    { string__append_list(["c2init ", TraceOpt | MkInitCmd0],
+	    	MkInitCmd) },
 	    invoke_system_command(MkInitCmd, MkInitOK),
 	    maybe_report_stats(Stats),
 	    ( { MkInitOK = no } ->
@@ -2492,7 +2493,8 @@
 		    { join_string_list(LinkObjectsList, "", "", " ",
 				LinkObjects) },
 		    { string__append_list(
-			["ml --grade ", Grade, " ", C_Debug_Opt, LinkFlags,
+			["ml --grade ", Grade, " ",
+			C_Debug_Opt, TraceOpt, LinkFlags,
 			" -o ", OutputFileName, " ",
 			InitObjFileName, " ", Objects, " ",
 			LinkObjects, " ",

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list