[m-rev.] diff: apply a workaround to fix `--intermod-unused-args'

Julien Fischer juliensf at cs.mu.OZ.AU
Fri Oct 15 15:24:29 AEST 2004


I mentioned this last year but didn't do anything about at
the time.  See:
<http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mercury-developers.200402/0017.html>

Estimated hours taken: 0.5
Branches: main

Apply a workaround so that the compiler boostraps with
`--intermod-unused-args'.  The compiler currently aborts
when trying to read the unused argument pragmas for any
compiler generated class insance methods from the `.opt' files.

It would also do the same for termination_info pragmas except
there is already a workaround in place for these.

compiler/unused_args.m:
	Do not output unused argument pragmas for compiler
	generated class instance methods as they cause
	the compiler to abort when reading them in from
	the `.opt' files.
Julien.

Index: compiler/unused_args.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.96
diff -u -r1.96 unused_args.m
--- compiler/unused_args.m	21 Jun 2004 03:26:06 -0000	1.96
+++ compiler/unused_args.m	15 Oct 2004 05:08:28 -0000
@@ -1537,7 +1537,15 @@
 				IdLen = Length - Position - 4,
 				string__right(Name, IdLen, Id),
 				string__to_int(Id, _)
-			)
+			),
+				% XXX We don't currently generate pragmas
+				% for the automatically generated class
+				% instance methods because the compiler
+				% aborts when trying to read them back in
+				% from the `.opt' files.
+			\+ check_marker(Markers, class_instance_method),
+			\+ check_marker(Markers, named_class_instance_method)
+
 		->
 			write_unused_args_to_opt_file(WriteOptPragmas,
 				PredInfo, ProcId, UnusedArgs, !IO),

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