diff: fix bug with transitive intermodule opt & --use-subdirs

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jun 29 00:12:27 AEST 1998


compiler/modules.m:
	Fix a bug: `read_dependency_file_get_modules' was not handling
	the case where the dependencies were generated with the
	`--use-subdirs' option enabled.

Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.78
diff -u -r1.78 modules.m
--- modules.m	1998/06/25 04:38:19	1.78
+++ modules.m	1998/06/28 14:05:33
@@ -1586,13 +1586,17 @@
 			\+ char__is_whitespace(Char)
 		)) },
 		{ list__takewhile(NotIsWhitespace, CharList1, CharList, _) },
-		% Remove the ".trans_opt" suffix from the word which was
-		% read in.
-		{ list__remove_suffix(CharList, 
-			['.','t','r','a','n','s','_','o','p','t'], 
-			ModuleCharList) }
+		{ string__from_char_list(CharList, FileName0) },
+		{ string__remove_suffix(FileName0, ".trans_opt", FileName) }
 	->
-		{ string__from_char_list(ModuleCharList, ModuleFileName) },
+		(
+			{ string__append("Mercury/trans_opts/", BaseFileName,
+				FileName) }
+		->
+			{ ModuleFileName = BaseFileName }
+		;
+			{ ModuleFileName = FileName }
+		),
 		{ file_name_to_module_name(ModuleFileName, Module) },
 		read_dependency_file_get_modules(TransOptDeps0),
 		{ TransOptDeps = [ Module | TransOptDeps0 ] }

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