[m-dev.] diff: GCC back-end: fix fact table Mmake dependencies

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 1 12:33:05 AEDT 2001


Estimated hours taken: 0.5

Fix a bug with the Mmake dependencies for fact tables with the GCC back-end.
This broke tests/hard_coded/factt.m with `--target asm'.

compiler/modules.m:
	If the module contains fact tables, then treat it as if it contains
	foreign code too, since the way we implement fact tables involves
	generating some inline C code.

Workspace: /home/hg/fjh/gcc-cvs/gcc/mercury
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.147
diff -u -d -r1.147 modules.m
--- compiler/modules.m	2001/01/29 06:47:18	1.147
+++ compiler/modules.m	2001/02/01 01:07:47
@@ -3232,19 +3232,26 @@
 	list__length(FactDeps, NumFactDeps),
 	list__duplicate(NumFactDeps, Module, ModuleList),
 	assoc_list__from_corresponding_lists(FactDeps, ModuleList,
-		NewLinkObjs0),
+		FactTableObjs),
 	%
-	% Handle object files for foreign code
+	% Handle object files for foreign code.
 	% XXX currently we only support `C' foreign code.
 	%
+	% Note that we implement fact tables by generating
+	% some inline C, so code which uses fact tables must
+	% be treated as if it also contained foreign code.
+	%
 	(
 		Target = asm,
-		ModuleImports ^ foreign_code = contains_foreign_code
+		( ModuleImports ^ foreign_code = contains_foreign_code
+		; FactTableObjs \= []
+		)
 	->
 		prog_out__sym_name_to_string(Module, ".", FileName),
-		NewLinkObjs = [(FileName ++ "__c_code") - Module | NewLinkObjs0]
+		NewLinkObjs = [(FileName ++ "__c_code") - Module |
+			FactTableObjs]
 	;
-		NewLinkObjs = NewLinkObjs0
+		NewLinkObjs = FactTableObjs
 	),
 	list__append(NewLinkObjs, ExtraLinkObjs0, ExtraLinkObjs1),
 	get_extra_link_objects_2(Modules, DepsMap, Target, ExtraLinkObjs1, 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list