[m-rev.] [reuse] add explicit aliases to library

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Tue May 15 01:47:09 AEST 2001


Hi,

these changes were still lying around... 


===================================================================


Estimated hours taken: 1
Branches: reuse

Add explicit aliasing information to foreign procedures. 

array.m:
char.m:
float.m:
int.m:
io.m:
math.m:
string.m:
	Add explicit aliasing information. 


Index: array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.72.2.8
diff -u -r1.72.2.8 array.m
--- array.m	2001/03/18 17:45:07	1.72.2.8
+++ array.m	2001/05/14 15:32:26
@@ -635,21 +635,25 @@
 
 :- pragma foreign_proc("C", 
 		array__init(Size::in, Item::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+		alias( yes(int, T, array(T)), 
+		 	[cel(Item,[]) - cel(Array,[T])])], "
 	MR_maybe_record_allocation(Size + 1, MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_make_array(Size, Item);
 ").
 
 :- pragma foreign_proc("C",
 		array__make_empty_array(Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	MR_maybe_record_allocation(1, MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_make_array(0, 0);
 ").
 
 :- pragma foreign_proc("MC++", 
 		array__init(Size::in, Item::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+		alias( yes(int, T, array(T)), 
+			[cel(Item,[]) - cel(Array,[T])])], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 		// XXX still need to do init
 	Array = (MR_Word) System::Array::CreateInstance(Item->GetType(), Size);
@@ -657,7 +661,7 @@
 
 :- pragma foreign_proc("MC++",
 		array__make_empty_array(Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 		// XXX this is inefficient.
 	Array = (MR_Word) 
@@ -670,27 +674,27 @@
 
 :- pragma foreign_proc("C",
 		array__min(Array::array_ui, Min::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	/* Array not used */
 	Min = 0;
 ").
 :- pragma foreign_proc("C", 
 		array__min(Array::in, Min::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	/* Array not used */
 	Min = 0;
 ").
 
 :- pragma foreign_proc("MC++",
 		array__min(Array::array_ui, Min::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	/* Array not used */
 	Min = 0;
 ").
 :- pragma foreign_proc("MC++", 
 		array__min(Array::in, Min::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	/* Array not used */
 	Min = 0;
@@ -698,23 +702,23 @@
 
 :- pragma foreign_proc("C", 
 		array__max(Array::array_ui, Max::out), 
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	Max = ((MR_ArrayType *)Array)->size - 1;
 ").
 :- pragma foreign_proc("C",
 		array__max(Array::in, Max::out), 
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	Max = ((MR_ArrayType *)Array)->size - 1;
 ").
 :- pragma foreign_proc("MC++", 
 		array__max(Array::array_ui, Max::out), 
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Max = Array->get_Length() - 1;
 ").
 :- pragma foreign_proc("MC++",
 		array__max(Array::in, Max::out), 
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Max = Array->get_Length() - 1;
 ").
@@ -728,24 +732,24 @@
 
 :- pragma foreign_proc("C",
 		array__size(Array::array_ui, Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	Max = ((MR_ArrayType *)Array)->size;
 ").
 :- pragma foreign_proc("C",
 		array__size(Array::in, Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	Max = ((MR_ArrayType *)Array)->size;
 ").
 
 :- pragma foreign_proc("MC++",
 		array__size(Array::array_ui, Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Max = Array->get_Length() - 1;
 ").
 :- pragma foreign_proc("MC++",
 		array__size(Array::in, Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Max = Array->get_Length() - 1;
 ").
@@ -777,7 +781,9 @@
 
 :- pragma foreign_proc("C",
 		array__lookup(Array::array_ui, Index::in, Item::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T), int, T), 
+			[ cel(Array, [T]) - cel(Item, []) ]) ], "{
 	MR_ArrayType *array = (MR_ArrayType *)Array;
 #ifndef ML_OMIT_ARRAY_BOUNDS_CHECKS
 	if ((MR_Unsigned) Index >= (MR_Unsigned) array->size) {
@@ -788,7 +794,9 @@
 }").
 :- pragma foreign_proc("C",
 		array__lookup(Array::in, Index::in, Item::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T), int, T), 
+			[ cel(Array, [T]) - cel(Item, []) ]) ], "{
 	MR_ArrayType *array = (MR_ArrayType *)Array;
 #ifndef ML_OMIT_ARRAY_BOUNDS_CHECKS
 	if ((MR_Unsigned) Index >= (MR_Unsigned) array->size) {
@@ -800,13 +808,17 @@
 
 :- pragma foreign_proc("MC++",
 		array__lookup(Array::array_ui, Index::in, Item::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T), int, T), 
+			[ cel(Array, [T]) - cel(Item, []) ]) ], "{
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Item = Array->GetValue(Index);
 }").
 :- pragma foreign_proc("MC++",
 		array__lookup(Array::in, Index::in, Item::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T), int, T), 
+			[ cel(Array, [T]) - cel(Item, []) ]) ], "{
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
 	Item = Array->GetValue(Index);
 }").
@@ -817,7 +829,10 @@
 :- pragma foreign_proc("C",
 		array__set(Array0::array_di, Index::in,
 		Item::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias( yes(array(T), int, T, array(T)), 
+			[ cel(Item,[]) - cel(Array, [T]),
+			  cel(Array0,[]) - cel(Array,[]) ]) ], "{
 	MR_ArrayType *array = (MR_ArrayType *)Array0;
 #ifndef ML_OMIT_ARRAY_BOUNDS_CHECKS
 	if ((MR_Unsigned) Index >= (MR_Unsigned) array->size) {
@@ -831,7 +846,10 @@
 :- pragma foreign_proc("MC++",
 		array__set(Array0::array_di, Index::in,
 		Item::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, 
+		alias( yes(array(T), int, T, array(T)), 
+			[ cel(Item,[]) - cel(Array, [T]),
+			  cel(Array0,[]) - cel(Array, []) ]) ], "{
 	Array0->SetValue(Item, Index);	/* destructive update! */
 	Array = Array0;
         mercury::runtime::Errors::SORRY(""foreign code for this predicate"");
@@ -881,7 +899,11 @@
 
 :- pragma foreign_proc("C",
 		array__resize(Array0::array_di, Size::in, Item::in,
-		Array::array_uo), [will_not_call_mercury, thread_safe], "
+		Array::array_uo), 
+		[will_not_call_mercury, thread_safe, 
+		alias( yes(array(T), int, T, array(T)), 
+			[ cel(Item,[]) - cel(Array, [T]),
+			  cel(Array0,[]) - cel(Array, []) ]) ], "
 	MR_maybe_record_allocation(Size + 1, MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_resize_array(
 				(MR_ArrayType *) Array0, Size, Item);
@@ -933,7 +955,8 @@
 
 :- pragma foreign_proc("C",
 		array__shrink(Array0::array_di, Size::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+		alias( no, [cel(Array0,[]) - cel(Array,[])])], "
 	MR_maybe_record_allocation(Size + 1, MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_shrink_array(
 				(MR_ArrayType *) Array0, Size);
@@ -976,7 +999,9 @@
 
 :- pragma foreign_proc("C",
 		array__copy(Array0::array_ui, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T),array(T)),
+			[ cel(Array0,[T]) - cel(Array,[T])])], "
 	MR_maybe_record_allocation((((MR_ArrayType *) Array0)->size) + 1,
 		MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_copy_array((MR_ArrayType *) Array0);
@@ -984,7 +1009,9 @@
 
 :- pragma foreign_proc("C",
 		array__copy(Array0::in, Array::array_uo),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+		alias(yes(array(T),array(T)),
+			[ cel(Array0,[T]) - cel(Array,[T])])], "
 	MR_maybe_record_allocation((((MR_ArrayType *) Array0)->size) + 1,
 		MR_PROC_LABEL, ""array:array/1"");
 	Array = (MR_Word) ML_copy_array((MR_ArrayType *) Array0);
Index: char.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/char.m,v
retrieving revision 1.28.6.4
diff -u -r1.28.6.4 char.m
--- char.m	2001/03/18 17:45:10	1.28.6.4
+++ char.m	2001/05/14 15:32:34
@@ -415,19 +415,19 @@
 
 :- pragma foreign_proc("C",
 	char__to_int(Character::in, Int::out),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	Int = (MR_UnsignedChar) Character;
 ").
 
 :- pragma foreign_proc("C",
 	char__to_int(Character::in, Int::in),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	SUCCESS_INDICATOR = ((MR_UnsignedChar) Character == Int);
 ").
 
 :- pragma foreign_proc("C",
 	char__to_int(Character::out, Int::in),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	/*
 	** If the integer doesn't fit into a char, then
 	** the assignment `Character = Int' below will truncate it.
@@ -440,19 +440,19 @@
 
 :- pragma foreign_proc("MC++",
 	char__to_int(Character::in, Int::out),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	Int = Character;
 ").
 
 :- pragma foreign_proc("MC++",
 	char__to_int(Character::in, Int::in),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	SUCCESS_INDICATOR = (Character == Int);
 ").
 
 :- pragma foreign_proc("MC++",
 	char__to_int(Character::out, Int::in),
-               [will_not_call_mercury, thread_safe] , "
+               [will_not_call_mercury, thread_safe, no_aliasing] , "
 	Character = Int;
 	SUCCESS_INDICATOR = (Character == Int);
 ").
@@ -465,13 +465,13 @@
 :- pragma c_header_code("#include <limits.h>").
 :- pragma foreign_proc("C",
 		char__max_char_value(Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	Max = UCHAR_MAX;
 ").
 
 :- pragma foreign_proc("MC++",
 		char__max_char_value(_Max::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 ").
 
Index: float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/float.m,v
retrieving revision 1.29.6.4
diff -u -r1.29.6.4 float.m
--- float.m	2001/03/18 17:45:11	1.29.6.4
+++ float.m	2001/05/14 15:32:38
@@ -377,12 +377,12 @@
 	% float__ceiling_to_int(X) returns the
 	% smallest integer not less than X.
 :- pragma foreign_proc("C", float__ceiling_to_int(X :: in) = (Ceil :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Ceil = (MR_Integer) ceil(X);
 ").
 :- pragma foreign_proc("MC++", float__ceiling_to_int(X :: in) = (Ceil :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Ceil = (MR_Integer) System::Math::Ceil(X);
 ").
@@ -392,12 +392,12 @@
 	% float__floor_to_int(X) returns the
 	% largest integer not greater than X.
 :- pragma foreign_proc("C", float__floor_to_int(X :: in) = (Floor :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Floor = (MR_Integer) floor(X);
 ").
 :- pragma foreign_proc("MC++", float__floor_to_int(X :: in) = (Floor :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Floor = (MR_Integer) System::Math::Floor(X);
 ").
@@ -407,12 +407,12 @@
 	% float__round_to_int(X) returns the integer closest to X.
 	% If X has a fractional value of 0.5, it is rounded up.
 :- pragma foreign_proc("C", float__round_to_int(X :: in) = (Round :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Round = (MR_Integer) floor(X + 0.5);
 ").
 :- pragma foreign_proc("MC++", float__round_to_int(X :: in) = (Round :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Round = (MR_Integer) System::Math::Floor(X + 0.5);
 ").
@@ -422,12 +422,12 @@
 	% float__truncate_to_int(X) returns the integer closest
 	% to X such that |float__truncate_to_int(X)| =< |X|.
 :- pragma foreign_proc("C", float__truncate_to_int(X :: in) = (Trunc :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Trunc = (MR_Integer) X;
 ").
 :- pragma foreign_proc("MC++", float__truncate_to_int(X :: in) = (Trunc :: out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	Trunc = (MR_Integer) X;
 ").
@@ -490,12 +490,12 @@
 float__pow(X, Exp, float__pow(X, Exp)).
 
 :- pragma foreign_proc("C", float__hash(F::in) = (H::out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	H = MR_hash_float(F);
 ").
 :- pragma foreign_proc("MC++", float__hash(F::in) = (H::out),
-	[will_not_call_mercury, thread_safe],
+	[will_not_call_mercury, thread_safe, no_aliasing],
 "
 	H = F.GetHashCode();
 ").
@@ -533,10 +533,10 @@
 
 	% Maximum floating-point number
 :- pragma foreign_proc("C", float__max = (Max::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Max = ML_FLOAT_MAX;").
 :- pragma foreign_proc("MC++", float__max = (Max::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Max = MR_BoxedFloat::MaxValue;").
 
 
@@ -544,30 +544,30 @@
 
 	% Minimum normalised floating-point number */
 :- pragma foreign_proc("C", float__min = (Min::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Min = ML_FLOAT_MIN;").
 :- pragma foreign_proc("MC++", float__min = (Min::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Min = MR_BoxedFloat::MinValue;").
 
 float__min(float__min).
 
 	% Smallest x such that x \= 1.0 + x
 :- pragma foreign_proc("C", float__epsilon = (Eps::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Eps = ML_FLOAT_EPSILON;").
 :- pragma foreign_proc("MC++", float__epsilon = (Eps::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Eps = MR_BoxedFloat::Epsilon;").
 
 float__epsilon(float__epsilon).
 
 	% Radix of the floating-point representation.
 :- pragma foreign_proc("C", float__radix = (Radix::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"Radix = ML_FLOAT_RADIX;").
 :- pragma foreign_proc("MC++", float__radix = (_Radix::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
@@ -575,10 +575,10 @@
 
 	% The number of base-radix digits in the mantissa.
 :- pragma foreign_proc("C", float__mantissa_digits = (MantDig::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"MantDig = ML_FLOAT_MANT_DIG;").
 :- pragma foreign_proc("MC++", float__mantissa_digits = (_MantDig::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
@@ -588,10 +588,10 @@
 	%	radix ** (min_exponent - 1)
 	% is a normalised floating-point number.
 :- pragma foreign_proc("C", float__min_exponent = (MinExp::out),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, no_aliasing],
 	"MinExp = ML_FLOAT_MIN_EXP;").
 :- pragma foreign_proc("MC++", float__min_exponent = (_MinExp::out),
-		[will_not_call_mercury, thread_safe], "	
+		[will_not_call_mercury, thread_safe, no_aliasing], "	
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
Index: int.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/int.m,v
retrieving revision 1.68.4.5
diff -u -r1.68.4.5 int.m
--- int.m	2001/03/18 17:45:12	1.68.4.5
+++ int.m	2001/05/14 15:32:40
@@ -478,12 +478,12 @@
 :- mode int__to_float(in, out) is det.
 */
 :- pragma foreign_proc("C", int__to_float(IntVal::in, FloatVal::out),
-		will_not_call_mercury,
+		[will_not_call_mercury, no_aliasing],
 "
 	FloatVal = IntVal;
 ").
 :- pragma foreign_proc("MC++", int__to_float(IntVal::in, FloatVal::out),
-		will_not_call_mercury,
+		[will_not_call_mercury, no_aliasing],
 "
 	FloatVal = (MR_Float) IntVal;
 ").
Index: io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.202.2.7
diff -u -r1.202.2.7 io.m
--- io.m	2001/04/20 15:24:01	1.202.2.7
+++ io.m	2001/05/14 15:32:49
@@ -1374,7 +1374,8 @@
 
 :- pragma foreign_proc("C", io__read_line_as_string_2(File::in, Res :: out,
 			RetString::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "
 #define ML_IO_READ_LINE_GROW(n)	((n) * 3 / 2)
 #define ML_IO_BYTES_TO_WORDS(n)	(((n) + sizeof(MR_Word) - 1) / sizeof(MR_Word))
@@ -1432,7 +1433,8 @@
 
 :- pragma foreign_proc("MC++", 
 	io__read_line_as_string_2(_File::in, _Res :: out, _RetString::out,
-		IO0::di, IO::uo), [will_not_call_mercury, thread_safe],
+		IO0::di, IO::uo), [will_not_call_mercury, thread_safe, 
+		no_aliasing],
 "
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 	update_io(IO0, IO);
@@ -1563,7 +1565,8 @@
 
 :- pragma foreign_proc("C", ferror(Stream::in, RetVal::out, RetStr::out,
 		_IO0::di, _IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	MercuryFile *f = (MercuryFile *) Stream;
 
@@ -1579,7 +1582,8 @@
 
 :- pragma foreign_proc("MC++", ferror(_Stream::in, _RetVal::out, _RetStr::out,
 		_IO0::di, _IO::uo),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, 
+		no_aliasing],
 "{
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 }").
@@ -2600,7 +2604,7 @@
 
 :- pragma foreign_proc("C", 
 		io__get_stream_names(StreamNames::out, IO0::di, IO::uo), 
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	StreamNames = ML_io_stream_names;
 	update_io(IO0, IO);
@@ -2608,7 +2612,7 @@
 
 :- pragma foreign_proc("C", 
 		io__set_stream_names(StreamNames::in, IO0::di, IO::uo), 
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	ML_io_stream_names = StreamNames;
 	update_io(IO0, IO);
@@ -2616,7 +2620,7 @@
 
 :- pragma foreign_proc("MC++", 
 		io__get_stream_names(StreamNames::out, IO0::di, IO::uo), 
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	StreamNames = ML_io_stream_names;
 	update_io(IO0, IO);
@@ -2624,7 +2628,7 @@
 
 :- pragma foreign_proc("MC++", 
 		io__set_stream_names(StreamNames::in, IO0::di, IO::uo), 
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	ML_io_stream_names = StreamNames;
 	update_io(IO0, IO);
@@ -3732,7 +3736,7 @@
 
 :- pragma foreign_proc("C",
 	io__write_string(Stream::in, Message::in, IO0::di, IO::uo),
-		[may_call_mercury, tabled_for_io, thread_safe], 
+		[may_call_mercury, tabled_for_io, thread_safe, no_aliasing], 
 "{
 	MercuryFile *stream = (MercuryFile *) Stream;
 	mercury_print_string(stream, Message);
@@ -3924,7 +3928,8 @@
 
 :- pragma foreign_proc("C",
 	io__stdin_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) &mercury_stdin;
 	update_io(IO0, IO);
@@ -3932,7 +3937,8 @@
 
 :- pragma foreign_proc("C",
 	io__stdout_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) &mercury_stdout;
 	update_io(IO0, IO);
@@ -3940,7 +3946,8 @@
 
 :- pragma foreign_proc("C",
 	io__stderr_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) &mercury_stderr;
 	update_io(IO0, IO);
@@ -3948,7 +3955,8 @@
 
 :- pragma foreign_proc("C",
 	io__stdin_binary_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) &mercury_stdin_binary;
 	update_io(IO0, IO);
@@ -3956,7 +3964,8 @@
 
 :- pragma foreign_proc("C",
 	io__stdout_binary_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) &mercury_stdout_binary;
 	update_io(IO0, IO);
@@ -3964,7 +3973,7 @@
 
 :- pragma foreign_proc("C",
 	io__input_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	Stream = (MR_Word) mercury_current_text_input;
 	update_io(IO0, IO);
@@ -3972,7 +3981,7 @@
 
 :- pragma foreign_proc("C",
 	io__output_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	Stream = (MR_Word) mercury_current_text_output;
 	update_io(IO0, IO);
@@ -3980,7 +3989,7 @@
 
 :- pragma foreign_proc("C",
 	io__binary_input_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	Stream = (MR_Word) mercury_current_binary_input;
 	update_io(IO0, IO);
@@ -3988,7 +3997,7 @@
 
 :- pragma foreign_proc("C",
 	io__binary_output_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	Stream = (MR_Word) mercury_current_binary_output;
 	update_io(IO0, IO);
@@ -3996,7 +4005,7 @@
 
 :- pragma foreign_proc("C",
 	io__get_line_number(LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	LineNum = MR_line_number(*mercury_current_text_input);
 	update_io(IO0, IO);
@@ -4004,7 +4013,7 @@
 	
 :- pragma foreign_proc("C",
 	io__get_line_number(Stream::in, LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	MercuryFile *stream = (MercuryFile *) Stream;
 	LineNum = MR_line_number(*stream);
@@ -4013,7 +4022,7 @@
 	
 :- pragma foreign_proc("C",
 	io__set_line_number(LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	MR_line_number(*mercury_current_text_input) = LineNum;
 	update_io(IO0, IO);
@@ -4021,7 +4030,7 @@
 	
 :- pragma foreign_proc("C",
 	io__set_line_number(Stream::in, LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	MercuryFile *stream = (MercuryFile *) Stream;
 	MR_line_number(*stream) = LineNum;
@@ -4030,7 +4039,7 @@
 	
 :- pragma foreign_proc("C",
 	io__get_output_line_number(LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	LineNum = MR_line_number(*mercury_current_text_output);
 	update_io(IO0, IO);
@@ -4038,7 +4047,7 @@
 	
 :- pragma foreign_proc("C",
 	io__get_output_line_number(Stream::in, LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	MercuryFile *stream = (MercuryFile *) Stream;
 	LineNum = MR_line_number(*stream);
@@ -4047,7 +4056,7 @@
 
 :- pragma foreign_proc("C",
 	io__set_output_line_number(LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	MR_line_number(*mercury_current_text_output) = LineNum;
 	update_io(IO0, IO);
@@ -4056,7 +4065,7 @@
 :- pragma foreign_proc("C",
 	io__set_output_line_number(Stream::in, LineNum::in,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	MercuryFile *stream = (MercuryFile *) Stream;
 	MR_line_number(*stream) = LineNum;
@@ -4069,7 +4078,7 @@
 :- pragma foreign_proc("C",
 	io__set_input_stream(NewStream::in, OutStream::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	OutStream = (MR_Word) mercury_current_text_input;
 	mercury_current_text_input = (MercuryFile *) NewStream;
@@ -4079,7 +4088,7 @@
 :- pragma foreign_proc("C",
 	io__set_output_stream(NewStream::in, OutStream::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	OutStream = (MR_Word) mercury_current_text_output;
 	mercury_current_text_output = (MercuryFile *) NewStream;
@@ -4089,7 +4098,7 @@
 :- pragma foreign_proc("C",
 	io__set_binary_input_stream(NewStream::in, OutStream::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	OutStream = (MR_Word) mercury_current_binary_input;
 	mercury_current_binary_input = (MercuryFile *) NewStream;
@@ -4099,7 +4108,7 @@
 :- pragma foreign_proc("C",
 	io__set_binary_output_stream(NewStream::in, OutStream::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	OutStream = (MR_Word) mercury_current_binary_output;
 	mercury_current_binary_output = (MercuryFile *) NewStream;
@@ -4108,7 +4117,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__stdin_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe, tabled_for_io],
+		[will_not_call_mercury, thread_safe, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_stdin);
 	update_io(IO0, IO);
@@ -4116,7 +4126,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__stdout_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe, tabled_for_io],
+		[will_not_call_mercury, thread_safe, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_stdout);
 	update_io(IO0, IO);
@@ -4124,7 +4135,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__stderr_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe, tabled_for_io],
+		[will_not_call_mercury, thread_safe, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_stderr);
 	update_io(IO0, IO);
@@ -4132,7 +4144,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__stdin_binary_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe, tabled_for_io],
+		[will_not_call_mercury, thread_safe, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_stdin_binary);
 	update_io(IO0, IO);
@@ -4140,7 +4153,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__stdout_binary_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe, tabled_for_io],
+		[will_not_call_mercury, thread_safe, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_stdout_binary);
 	update_io(IO0, IO);
@@ -4148,7 +4162,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__input_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_current_text_input);
 	update_io(IO0, IO);
@@ -4156,7 +4171,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__output_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_current_text_output);
 	update_io(IO0, IO);
@@ -4164,7 +4180,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__binary_input_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_current_binary_input);
 	update_io(IO0, IO);
@@ -4172,7 +4189,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__binary_output_stream(Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	MR_c_pointer_to_word(Stream, mercury_current_binary_output);
 	update_io(IO0, IO);
@@ -4180,7 +4198,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__get_line_number(LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	LineNum = mercury_current_text_input->line_number;
 	update_io(IO0, IO);
@@ -4188,7 +4207,8 @@
 	
 :- pragma foreign_proc("MC++",
 	io__get_line_number(Stream::in, LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "{
 	MR_MercuryFile stream = ML_DownCast(MR_MercuryFile, 
 		MR_word_to_c_pointer(Stream));
@@ -4198,7 +4218,8 @@
 	
 :- pragma foreign_proc("MC++",
 	io__set_line_number(LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "
 	mercury_current_text_input->line_number = LineNum;
 	update_io(IO0, IO);
@@ -4206,7 +4227,8 @@
 	
 :- pragma foreign_proc("MC++",
 	io__set_line_number(Stream::in, LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing],
 "{
 	MR_MercuryFile stream = ML_DownCast(MR_MercuryFile, 
 		MR_word_to_c_pointer(Stream));
@@ -4216,14 +4238,16 @@
 	
 :- pragma foreign_proc("MC++",
 	io__get_output_line_number(LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io], "
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing], "
 	LineNum = mercury_current_text_output->line_number;
 	update_io(IO0, IO);
 ").
 	
 :- pragma foreign_proc("MC++",
 	io__get_output_line_number(Stream::in, LineNum::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io], "{
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing], "{
 	MR_MercuryFile stream = ML_DownCast(MR_MercuryFile, 
 		MR_word_to_c_pointer(Stream));
 	LineNum = stream->line_number;
@@ -4232,14 +4256,16 @@
 
 :- pragma foreign_proc("MC++",
 	io__set_output_line_number(LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io], "
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing], "
 	mercury_current_text_output->line_number = LineNum;
 	update_io(IO0, IO);
 ").
 	
 :- pragma foreign_proc("MC++",
 	io__set_output_line_number(Stream::in, LineNum::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io], "{
+		[will_not_call_mercury, tabled_for_io,
+		no_aliasing], "{
 	MR_MercuryFile stream = ML_DownCast(MR_MercuryFile, 
 		MR_word_to_c_pointer(Stream));
 	stream->line_number = LineNum;
@@ -4296,7 +4322,8 @@
 :- pragma foreign_proc("C",
 	io__do_open(FileName::in, Mode::in, ResultCode::out,
 		Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	Stream = (MR_Word) mercury_open(FileName, Mode);
@@ -4306,7 +4333,8 @@
 :- pragma foreign_proc("MC++",
 	io__do_open(FileName::in, Mode::in, ResultCode::out,
 		Stream::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe,
+			no_aliasing],
 "
 	MR_MercuryFile mf = mercury_open(FileName, Mode);
 	MR_c_pointer_to_word(Stream, mf);
@@ -4350,7 +4378,8 @@
 
 :- pragma foreign_proc("C",
 	io__progname(DefaultProgname::in, PrognameOut::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		alias(no, [cel(DefaultProgname, []) - cel(PrognameOut, [])])],
 "
 	if (MR_progname) {
 		/*
@@ -4372,7 +4401,8 @@
 
 :- pragma foreign_proc("C",
 	io__command_line_arguments(Args::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "
 	/* convert mercury_argv from a vector to a list */
 	{ int i = mercury_argc;
@@ -4387,7 +4417,7 @@
 
 :- pragma foreign_proc("C",
 	io__get_exit_status(ExitStatus::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io], 
+		[will_not_call_mercury, tabled_for_io, no_aliasing], 
 "
 	ExitStatus = mercury_exit_status;
 	update_io(IO0, IO);
@@ -4395,7 +4425,7 @@
 
 :- pragma foreign_proc("C",
 	io__set_exit_status(ExitStatus::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	mercury_exit_status = ExitStatus;
 	update_io(IO0, IO);
@@ -4403,7 +4433,7 @@
 
 :- pragma foreign_proc("C",
 	io__call_system_code(Command::in, Status::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	Status = system(Command);
 	if ( Status == -1 || Status == 127 ) {
@@ -4445,7 +4475,8 @@
 
 :- pragma foreign_proc("MC++",
 	io__command_line_arguments(Args::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe], "
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing], "
 	MR_String arg_vector __gc[] = System::Environment::GetCommandLineArgs();
 	int i = arg_vector->Length;
 	MR_list_nil(Args);
@@ -4458,7 +4489,7 @@
 
 :- pragma foreign_proc("MC++",
 	io__get_exit_status(ExitStatus::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	ExitStatus = System::Environment::get_ExitCode();
 	update_io(IO0, IO);
@@ -4466,7 +4497,7 @@
 
 :- pragma foreign_proc("MC++",
 	io__set_exit_status(ExitStatus::in, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 	System::Environment::set_ExitCode(ExitStatus);
 	update_io(IO0, IO);
@@ -4474,7 +4505,7 @@
 
 :- pragma foreign_proc("MC++",
 	io__call_system_code(Command::in, Status::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "
 		// XXX This could be better... need to handle embedded spaces.
 	MR_Integer index = Command->IndexOf("" "");
@@ -4493,7 +4524,7 @@
 /* io__getenv and io__putenv, from io.m */
 
 :- pragma foreign_proc("C", io__getenv(Var::in, Value::out),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	Value = getenv(Var);
 	SUCCESS_INDICATOR = (Value != 0);
@@ -4506,7 +4537,7 @@
 ").
 
 :- pragma foreign_proc("MC++", io__getenv(Var::in, Value::out),
-		[will_not_call_mercury, tabled_for_io],
+		[will_not_call_mercury, tabled_for_io, no_aliasing],
 "{
 	Value = System::Environment::GetEnvironmentVariable(Var);
 	SUCCESS_INDICATOR = (Value != 0);
@@ -4589,7 +4620,8 @@
 :- pragma foreign_proc("C",
 	io__do_make_temp(Dir::in, Prefix::in, FileName::out,
 		Error::out, ErrorMessage::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	/*
 	** Constructs a temporary name by concatenating Dir, `/',
@@ -4640,7 +4672,8 @@
 :- pragma foreign_proc("MC++",
 	io__do_make_temp(_Dir::in, _Prefix::in, _FileName::out,
 		_Error::out, _ErrorMessage::out, IO0::di, IO::uo),
-		[will_not_call_mercury, thread_safe],
+		[will_not_call_mercury, thread_safe, 
+		no_aliasing],
 "{
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 	update_io(IO0, IO);
@@ -4707,7 +4740,8 @@
 :- pragma foreign_proc("C",
 	io__remove_file_2(FileName::in, RetVal::out, RetStr::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	RetVal = remove(FileName);
 	ML_maybe_make_err_msg(RetVal != 0, ""remove failed: "",
@@ -4718,7 +4752,8 @@
 :- pragma foreign_proc("MC++",
 	io__remove_file_2(FileName::in, RetVal::out, RetStr::out,
 		IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 	System::IO::File::Delete(FileName);
@@ -4742,7 +4777,8 @@
 :- pragma foreign_proc("C",
 		io__rename_file_2(OldFileName::in, NewFileName::in,
 			RetVal::out, RetStr::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	RetVal = rename(OldFileName, NewFileName);
 	ML_maybe_make_err_msg(RetVal != 0, ""rename failed: "",
@@ -4753,7 +4789,8 @@
 :- pragma foreign_proc("MC++",
 		io__rename_file_2(_OldFileName::in, _NewFileName::in,
 			_RetVal::out, _RetStr::out, IO0::di, IO::uo),
-		[will_not_call_mercury, tabled_for_io, thread_safe],
+		[will_not_call_mercury, tabled_for_io, thread_safe, 
+		no_aliasing],
 "{
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 	update_io(IO0, IO);
Index: math.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/math.m,v
retrieving revision 1.24.4.3
diff -u -r1.24.4.3 math.m
--- math.m	2001/03/18 17:45:18	1.24.4.3
+++ math.m	2001/05/14 15:32:54
@@ -277,21 +277,25 @@
 %
 	% Pythagoras' number
 :- pragma foreign_proc("C", 
-	math__pi = (Pi::out), [will_not_call_mercury, thread_safe],"
+	math__pi = (Pi::out), [will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Pi = ML_FLOAT_PI;
 ").
 :- pragma foreign_proc("MC++", 
-	math__pi = (Pi::out), [will_not_call_mercury, thread_safe],"
+	math__pi = (Pi::out), [will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Pi = System::Math::PI;
 ").
 
 	% Base of natural logarithms
 :- pragma foreign_proc("C", 
-	math__e = (E::out), [will_not_call_mercury, thread_safe],"
+	math__e = (E::out), [will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	E = ML_FLOAT_E;
 ").
 :- pragma foreign_proc("MC++", 
-	math__e = (E::out), [will_not_call_mercury, thread_safe],"
+	math__e = (E::out), [will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	E = System::Math::E;
 ").
 
@@ -301,12 +305,14 @@
 %
 :- pragma foreign_proc("C", 
 	math__ceiling(Num::in) = (Ceil::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Ceil = ceil(Num);
 ").
 :- pragma foreign_proc("MC++", 
 	math__ceiling(Num::in) = (Ceil::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Ceil = System::Math::Ceil(Num);
 ").
 
@@ -316,12 +322,14 @@
 %
 :- pragma foreign_proc("C", 
 	math__floor(Num::in) = (Floor::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Floor = floor(Num);
 ").
 :- pragma foreign_proc("MC++", 
 	math__floor(Num::in) = (Floor::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Floor = System::Math::Floor(Num);
 ").
 
@@ -332,12 +340,14 @@
 %
 :- pragma foreign_proc("C", 
 	math__round(Num::in) = (Rounded::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	Rounded = floor(Num+0.5);
 ").
 :- pragma foreign_proc("MC++", 
 	math__round(Num::in) = (Rounded::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	// XXX the semantics of System::Math::Round() are not the same as ours.
 	// Unfortunately they are better (round to nearest even number).
 	Rounded = System::Math::Floor(Num+0.5);
@@ -349,7 +359,8 @@
 %
 :- pragma foreign_proc("C",
 	math__truncate(X::in) = (Trunc::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	if (X < 0.0) {
 		Trunc = ceil(X);
 	} else {
@@ -358,7 +369,8 @@
 ").
 :- pragma foreign_proc("MC++",
 	math__truncate(X::in) = (Trunc::out),
-		[will_not_call_mercury, thread_safe],"
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing],"
 	if (X < 0.0) {
 		Trunc = System::Math::Ceil(X);
 	} else {
@@ -374,7 +386,8 @@
 %		X >= 0
 %
 :- pragma foreign_proc("C", math__sqrt(X::in) = (SquareRoot::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing], "
 #ifndef ML_OMIT_MATH_DOMAIN_CHECKS
 	if (X < 0.0) {
 		ML_math_domain_error(""math__sqrt"");
@@ -383,7 +396,8 @@
 	SquareRoot = sqrt(X);
 ").
 :- pragma foreign_proc("MC++", math__sqrt(X::in) = (SquareRoot::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, 
+				no_aliasing], "
 #ifndef ML_OMIT_MATH_DOMAIN_CHECKS
 	if (X < 0.0) {
 		ML_math_domain_error(""math__sqrt"");
Index: string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.128.2.8
diff -u -r1.128.2.8 string.m
--- string.m	2001/03/18 17:45:26	1.128.2.8
+++ string.m	2001/05/14 15:33:18
@@ -679,7 +679,7 @@
 */
 
 :- pragma foreign_proc("C", string__to_char_list(Str::in, CharList::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_ConstString p = Str + strlen(Str);
 	CharList = MR_list_empty_msg(MR_PROC_LABEL);
 	while (p > Str) {
@@ -690,7 +690,7 @@
 }").
 
 :- pragma foreign_proc("C", string__to_char_list(Str::out, CharList::in),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 		/* mode (out, in) is det */
 	MR_Word char_list_ptr;
 	size_t size;
@@ -733,7 +733,7 @@
 % it improves the overall speed of parsing by about 7%.
 %
 :- pragma foreign_proc("C", string__from_rev_char_list(Chars::in, Str::out),
-		[will_not_call_mercury, thread_safe], "
+		[will_not_call_mercury, thread_safe, no_aliasing], "
 {
 	MR_Word list_ptr;
 	MR_Word size, len;
@@ -772,7 +772,7 @@
 }").
 
 :- pragma foreign_proc("MC++", string__to_char_list(Str::in, CharList::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
         MR_Integer length, i; 
         MR_Word tmp;
         MR_Word prev;
@@ -791,7 +791,7 @@
 }").
 
 :- pragma foreign_proc("MC++", string__to_char_list(Str::out, CharList::in),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
         System::Text::StringBuilder *tmp;
 	MR_Char c;
        
@@ -809,8 +809,8 @@
 }").
 
 :- pragma foreign_proc("MC++", string__from_rev_char_list(_Chars::in,
-		_Str::out), [will_not_call_mercury, thread_safe], "
-{
+		_Str::out), [will_not_call_mercury, thread_safe, no_aliasing],
+"{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -937,7 +937,7 @@
 	% Implementation of append_list that uses C as this minimises the
 	% amount of garbage created.
 :- pragma foreign_proc("C", string__append_list(Strs::in) = (Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_Word	list = Strs;
 	MR_Word	tmp;
 	size_t	len = 0;
@@ -965,7 +965,7 @@
 }").
 
 :- pragma foreign_proc("MC++", string__append_list(_Strs::in) = (_Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -1390,14 +1390,14 @@
 :- func int_length_modifer = string.
 :- pragma foreign_proc("C", 
 	int_length_modifer = (LengthModifier::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_make_aligned_string(LengthModifier,
 		(MR_String) (MR_Word) MR_INTEGER_LENGTH_MODIFIER);
 }").
 
 :- pragma foreign_proc("MC++", 
 	int_length_modifer = (_LengthModifier::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -1408,14 +1408,14 @@
 :- func format_float(string, float) = string.
 :- pragma foreign_proc("C",
 	format_float(FormatStr::in, Val::in) = (Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_save_transient_hp();
 	Str = MR_make_string(MR_PROC_LABEL, FormatStr, (double) Val);
 	MR_restore_transient_hp();
 }").
 :- pragma foreign_proc("MC++",
 	format_float(_FormatStr::in, _Val::in) = (_Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -1425,14 +1425,14 @@
 :- func format_int(string, int) = string.
 :- pragma foreign_proc("C",
 	format_int(FormatStr::in, Val::in) = (Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_save_transient_hp();
 	Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
 	MR_restore_transient_hp();
 }").
 :- pragma foreign_proc("MC++",
 	format_int(_FormatStr::in, _Val::in) = (_Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -1442,12 +1442,12 @@
 :- func format_string(string, string) = string.
 :- pragma foreign_proc("C", 
 	format_string(FormatStr::in, Val::in) = (Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
 }").
 :- pragma foreign_proc("MC++", 
 	format_string(_FormatStr::in, _Val::in) = (_Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 
@@ -1457,14 +1457,14 @@
 :- func format_char(string, char) = string.
 :- pragma foreign_proc("C", 
 	format_char(FormatStr::in, Val::in) = (Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	MR_save_transient_hp();
 	Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
 	MR_restore_transient_hp();
 }").
 :- pragma foreign_proc("MC++", 
 	format_char(_FormatStr::in, _Val::in) = (_Str::out),
-		[will_not_call_mercury, thread_safe], "{
+		[will_not_call_mercury, thread_safe, no_aliasing], "{
 	mercury::runtime::Errors::SORRY(""c code for this function"");
 }").
 

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