[m-rev.] diff: "fix" lcc compilation errors

Simon Taylor stayl at cs.mu.OZ.AU
Thu Jul 12 01:45:01 AEST 2001


Estimated hours taken: 0.5
Branches: main

recompilation.m:
	Slightly modify the types defined in this module to avoid a bogus
	syntax error when compiling the C generated for it using lcc.

recompilation_check.m:
recompilation_usage.m:
recompilation_version.m:
	Changes required by the above.

Index: recompilation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation.m,v
retrieving revision 1.1
diff -u -u -r1.1 recompilation.m
--- recompilation.m	27 Jun 2001 05:04:26 -0000	1.1
+++ recompilation.m	11 Jul 2001 12:15:01 -0000
@@ -200,8 +200,11 @@
 %-----------------------------------------------------------------------------%
 
 	% Version numbers for items in a single module.
-:- type version_numbers == pair(item_version_numbers,
-				instance_version_numbers).
+:- type version_numbers
+	---> version_numbers(
+		item_version_numbers,
+		instance_version_numbers
+	).
 
 	% The constructors set should always be empty -
 	% constructors are never imported separately.
Index: recompilation_check.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_check.m,v
retrieving revision 1.2
diff -u -u -r1.2 recompilation_check.m
--- recompilation_check.m	6 Jul 2001 11:25:31 -0000	1.2
+++ recompilation_check.m	11 Jul 2001 08:34:57 -0000
@@ -715,10 +715,10 @@
 		throw(recompile_exception(Reason, Info0))
 	},
 
-	{ UsedVersionNumbers = UsedItemVersionNumbers
-				- UsedInstanceVersionNumbers },
-	{ NewVersionNumbers = NewItemVersionNumbers
-				- NewInstanceVersionNumbers },
+	{ UsedVersionNumbers = version_numbers(UsedItemVersionNumbers,
+				UsedInstanceVersionNumbers) },
+	{ NewVersionNumbers = version_numbers(NewItemVersionNumbers,
+				NewInstanceVersionNumbers) },
 
 	%
 	% Check whether any of the items which were used have changed.
Index: recompilation_usage.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_usage.m,v
retrieving revision 1.1
diff -u -u -r1.1 recompilation_usage.m
--- recompilation_usage.m	27 Jun 2001 05:04:28 -0000	1.1
+++ recompilation_usage.m	11 Jul 2001 08:47:33 -0000
@@ -211,14 +211,16 @@
 			% XXX We don't yet record all uses of items
 			% from these modules in polymorphism.m, etc.
 			\+ { any_mercury_builtin_module(ModuleName) },
-			{ map__search(RecompInfo ^ version_numbers, ModuleName,
-				ModuleItemVersions - ModuleInstanceVersions) }
+			{ map__search(RecompInfo ^ version_numbers,
+				ModuleName, ModuleVersions) }
 		->
 			%
 			% Select out from the version numbers of all items
 			% in the imported module the ones which are used.
 			%
 
+			{ ModuleVersions = version_numbers(ModuleItemVersions,
+						ModuleInstanceVersions) },
 			{ ModuleUsedItemVersions = map_ids(
 				(func(ItemType, Ids0) = Ids :-
 					ModuleItemNames = extract_ids(
@@ -240,8 +242,9 @@
 			},
 
 			io__write_string(" => "),
-			{ ModuleUsedVersionNumbers = ModuleUsedItemVersions
-						- ModuleUsedInstanceVersions },
+			{ ModuleUsedVersionNumbers =
+				version_numbers(ModuleUsedItemVersions,
+						ModuleUsedInstanceVersions) },
 			recompilation_version__write_version_numbers(
 				ModuleUsedVersionNumbers),
 			io__write_string(".\n")
Index: recompilation_version.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation_version.m,v
retrieving revision 1.1
diff -u -u -r1.1 recompilation_version.m
--- recompilation_version.m	27 Jun 2001 05:04:29 -0000	1.1
+++ recompilation_version.m	11 Jul 2001 08:51:24 -0000
@@ -37,7 +37,7 @@
 :- import_module assoc_list, bool, list, map, require, string.
 
 recompilation_version__compute_version_numbers(SourceFileTime, Items,
-		MaybeOldItems, ItemVersionNumbers - InstanceVersionNumbers) :-
+		MaybeOldItems, version_numbers(ItemVersionNumbers, InstanceVersionNumbers)) :-
 	recompilation_version__gather_items(Items,
 		GatheredItems, InstanceItems),
 	(
@@ -46,8 +46,8 @@
 		VersionNumberItem = module_defn(_,
 			version_numbers(_, OldVersionNumbers)) - _
 	->
-		OldVersionNumbers = OldItemVersionNumbers
-					- OldInstanceVersionNumbers,
+		OldVersionNumbers = version_numbers(OldItemVersionNumbers,
+					OldInstanceVersionNumbers),
 		recompilation_version__gather_items(OldItems, GatheredOldItems,
 			OldInstanceItems)
 	;
@@ -472,7 +472,7 @@
 %-----------------------------------------------------------------------------%
 
 recompilation_version__write_version_numbers(
-		VersionNumbers - InstanceVersionNumbers) -->
+		version_numbers(VersionNumbers, InstanceVersionNumbers)) -->
 	{ VersionNumbersList = list__filter_map(
 		(func(ItemType) = (ItemType - ItemVersions) is semidet :-
 			ItemVersions = extract_ids(VersionNumbers, ItemType),
@@ -543,9 +543,11 @@
 		VersionNumbersTermList, Result0),
 	(
 		Result0 = ok(List),
-		VersionNumbers0 = init_item_id_set(map__init) - map__init,
+		VersionNumbers0 = version_numbers(init_item_id_set(map__init),
+						map__init),
 		VersionNumbers = list__foldl(
-		    (func(VNResult, VNs0 - Instances0) = VNs - Instances :-
+		    (func(VNResult, version_numbers(VNs0, Instances0)) =
+		    		version_numbers(VNs, Instances) :-
 			( 
 				VNResult = items(ItemType, ItemVNs),
 				VNs = update_ids(VNs0, ItemType, ItemVNs),
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list