diff: mercury_compile.m: memory profiling fix

Fergus Henderson fjh at cs.mu.oz.au
Mon Dec 8 08:09:38 AEDT 1997


Fix a bug with memory profiling.

compiler/mercury_compile.m:
	If --profile-memory was specified, then pass `-DPROFILE_MEMORY'
	to the C compiler.

Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.61
diff -u -u -r1.61 mercury_compile.m
--- mercury_compile.m	1997/12/05 15:47:34	1.61
+++ mercury_compile.m	1997/12/07 21:05:08
@@ -1826,6 +1826,12 @@
 	;
 		ProfileTimeOpt = ""
 	},
+	globals__io_lookup_bool_option(profile_memory, ProfileMemory),
+	{ ProfileMemory = yes ->
+		ProfileMemoryOpt = "-DPROFILE_MEMORY "
+	;
+		ProfileMemoryOpt = ""
+	},
 	globals__io_lookup_bool_option(pic_reg, PIC_Reg),
 	{ PIC_Reg = yes ->
 		PIC_Reg_Opt = "-DPIC_REG "
@@ -1916,8 +1922,8 @@
 	{ string__append_list([CC, " ", InclOpt, SplitOpt, OptimizeOpt,
 		RegOpt, GotoOpt, AsmOpt,
 		CFLAGS_FOR_REGS, " ", CFLAGS_FOR_GOTOS, " ",
-		GC_Opt, ProfileCallsOpt, ProfileTimeOpt, PIC_Reg_Opt,
-		TagsOpt, NumTagBitsOpt, DebugOpt,
+		GC_Opt, ProfileCallsOpt, ProfileTimeOpt, ProfileMemoryOpt,
+		PIC_Reg_Opt, TagsOpt, NumTagBitsOpt, DebugOpt,
 		UseTrailOpt, ArgsOpt, TypeInfoOpt, TypeLayoutOpt,
 		InlineAllocOpt, WarningOpt, CFLAGS,
 		" -c ", C_File, " -o ", O_File], Command) },

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