[m-rev.] diff: handle aliasing foreign code attributes

Peter Ross peter.ross at miscrit.be
Fri Mar 23 01:40:38 AEDT 2001


Hi,


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


Estimated hours taken: 1
Branches: main

Ignore no_aliasing, unknown_aliasing and alias/2 attributes on
pragma_foreign_code.  This allows the main branch to compile the
reuse branch.

compiler/prog_io_pragma.m:
    Parse no_aliasing, unknown_aliasing and alias/2 attributes.

Index: compiler/prog_io_pragma.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
retrieving revision 1.27
diff -u -r1.27 prog_io_pragma.m
--- compiler/prog_io_pragma.m	2001/01/19 03:17:31	1.27
+++ compiler/prog_io_pragma.m	2001/03/22 14:30:36
@@ -1088,7 +1088,8 @@
 :- type collected_pragma_foreign_code_attribute
 	--->	may_call_mercury(may_call_mercury)
 	;	thread_safe(thread_safe)
-	;	tabled_for_io(tabled_for_io).
+	;	tabled_for_io(tabled_for_io)
+	;	aliasing.
 
 :- pred parse_pragma_foreign_code_attributes_term(foreign_language, term, 
 		pragma_foreign_code_attributes).
@@ -1162,6 +1163,8 @@
 		Flag = thread_safe(ThreadSafe)
 	; parse_tabled_for_io(Term, TabledForIo) ->
 		Flag = tabled_for_io(TabledForIo)
+	; parse_aliasing(Term) ->
+		Flag = aliasing
 	;
 		fail
 	).
@@ -1193,6 +1196,17 @@
 	tabled_for_io).
 parse_tabled_for_io(term__functor(term__atom("not_tabled_for_io"), [], _),
 	not_tabled_for_io).
+
+	% XXX For the moment we just ignore the following attributes.
+	% These attributes are used for aliasing on the reuse branch,
+	% and ignoring them allows the main branch compiler to compile
+	% the reuse branch.
+:- pred parse_aliasing(term).
+:- mode parse_aliasing(in) is semidet.
+
+parse_aliasing(term__functor(term__atom("no_aliasing"), [], _)).
+parse_aliasing(term__functor(term__atom("unknown_aliasing"), [], _)).
+parse_aliasing(term__functor(term__atom("alias"), [_Types, _Alias], _)).
 
 % parse a pragma foreign_code declaration
 
--------------------------------------------------------------------------
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