[m-rev.] for review: use getopt_io

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jan 24 13:24:52 AEDT 2005


The diff is trivial. Any comments on the idea?

Zoltan.

compiler/*.m:
	Import getopt_io instead instead of getopt, to allow Mmakefiles
	to specify that some options come from files.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.64
diff -u -b -r1.64 compile_target_code.m
--- compiler/compile_target_code.m	19 Jan 2005 03:10:31 -0000	1.64
+++ compiler/compile_target_code.m	23 Jan 2005 05:27:31 -0000
@@ -166,7 +166,7 @@
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_out.
 
-:- import_module char, dir, getopt, int, require, string.
+:- import_module char, dir, getopt_io, int, require, string.
 
 il_assemble(ErrorStream, ModuleName, HasMain, Succeeded, !IO) :-
 	module_name_to_file_name(ModuleName, ".il", no, IL_File, !IO),
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.43
diff -u -b -r1.43 deforest.m
--- compiler/deforest.m	21 Jan 2005 06:20:37 -0000	1.43
+++ compiler/deforest.m	23 Jan 2005 05:30:16 -0000
@@ -76,7 +76,7 @@
 :- import_module transform_hlds__pd_term.
 :- import_module transform_hlds__pd_util.
 
-:- import_module assoc_list, bool, getopt, int, list, map, require.
+:- import_module assoc_list, bool, getopt_io, int, list, map, require.
 :- import_module set, std_util, string, term, varset.
 
 deforestation(!ModuleInfo, !IO) :-
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.97
diff -u -b -r1.97 det_report.m
--- compiler/det_report.m	21 Jan 2005 06:20:37 -0000	1.97
+++ compiler/det_report.m	23 Jan 2005 05:28:00 -0000
@@ -153,7 +153,7 @@
 :- import_module parse_tree__prog_type.
 
 :- import_module assoc_list, bool, int, map, set, std_util, require, string.
-:- import_module getopt, term, varset.
+:- import_module getopt_io, term, varset.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/exprn_aux.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/exprn_aux.m,v
retrieving revision 1.53
diff -u -b -r1.53 exprn_aux.m
--- compiler/exprn_aux.m	9 Dec 2004 02:02:22 -0000	1.53
+++ compiler/exprn_aux.m	23 Jan 2005 05:30:41 -0000
@@ -102,13 +102,13 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 
-:- import_module int, set, require, getopt.
+:- import_module int, set, require, getopt_io.
 
 exprn_aux__init_exprn_opts(Options, ExprnOpts) :-
-	getopt__lookup_bool_option(Options, gcc_non_local_gotos, NLG),
-	getopt__lookup_bool_option(Options, asm_labels, ASM),
-	getopt__lookup_bool_option(Options, static_ground_terms, SGT),
-	getopt__lookup_bool_option(Options, unboxed_float, UBF),
+	getopt_io__lookup_bool_option(Options, gcc_non_local_gotos, NLG),
+	getopt_io__lookup_bool_option(Options, asm_labels, ASM),
+	getopt_io__lookup_bool_option(Options, static_ground_terms, SGT),
+	getopt_io__lookup_bool_option(Options, unboxed_float, UBF),
 	ExprnOpts = nlg_asm_sgt_ubf(NLG, ASM, SGT, UBF).
 
 % Determine whether a const (well, what _we_ consider to be a const)
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.58
diff -u -b -r1.58 fact_table.m
--- compiler/fact_table.m	21 Jan 2005 06:20:37 -0000	1.58
+++ compiler/fact_table.m	23 Jan 2005 05:30:50 -0000
@@ -112,7 +112,7 @@
 
 % Standard library modules
 :- import_module int, map, std_util, assoc_list, char, require, library, bool.
-:- import_module float, math, getopt, string.
+:- import_module float, math, getopt_io, string.
 :- import_module parser, term, term_io.
 
 :- type fact_result
Index: compiler/globals.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.63
diff -u -b -r1.63 globals.m
--- compiler/globals.m	19 Jan 2005 03:10:33 -0000	1.63
+++ compiler/globals.m	23 Jan 2005 05:10:03 -0000
@@ -22,7 +22,7 @@
 :- import_module mdbcomp.
 :- import_module mdbcomp__prim_data. % for module_name
 
-:- import_module bool, getopt, list, map, io, std_util.
+:- import_module bool, getopt_io, list, map, io, std_util.
 
 :- type globals.
 
@@ -411,9 +411,9 @@
 	bool::out) is det.
 
 globals__have_static_code_addresses_2(OptionTable, IsConst) :-
-	getopt__lookup_bool_option(OptionTable, gcc_non_local_gotos,
+	getopt_io__lookup_bool_option(OptionTable, gcc_non_local_gotos,
 		NonLocalGotos),
-	getopt__lookup_bool_option(OptionTable, asm_labels, AsmLabels),
+	getopt_io__lookup_bool_option(OptionTable, asm_labels, AsmLabels),
 	globals__imported_is_constant(NonLocalGotos, AsmLabels, IsConst).
 
 globals__want_return_var_layouts(Globals, WantReturnLayouts) :-
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.215
diff -u -b -r1.215 handle_options.m
--- compiler/handle_options.m	14 Jan 2005 05:56:02 -0000	1.215
+++ compiler/handle_options.m	23 Jan 2005 05:09:34 -0000
@@ -21,7 +21,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 
-:- import_module list, bool, getopt, io.
+:- import_module list, bool, getopt_io, io.
 
 	% handle_options(Args, Errors, OptionArgs, NonOptionArgs, Link).
 :- pred handle_options(list(string)::in, list(string)::out, list(string)::out,
@@ -33,7 +33,7 @@
 	% modify the globals. This is mainly useful for separating
 	% the list of arguments into option and non-option arguments.
 :- pred process_options(list(string)::in, list(string)::out, list(string)::out,
-	maybe_option_table(option)::out) is det.
+	maybe_option_table(option)::out, io::di, io::uo) is det.
 
 	% Display the compiler version.
 	%
@@ -77,7 +77,7 @@
 handle_options(Args0, Errors, OptionArgs, Args, Link) -->
 	% io__write_string("original arguments\n"),
 	% dump_arguments(Args0),
-	{ process_options(Args0, OptionArgs, Args, Result) },
+	process_options(Args0, OptionArgs, Args, Result),
 	% io__write_string("final arguments\n"),
 	% dump_arguments(Args),
 	postprocess_options(Result, Errors),
@@ -126,10 +126,11 @@
 		)
 	).
 
-process_options(Args0, OptionArgs, Args, Result) :-
+process_options(Args0, OptionArgs, Args, Result, !IO) :-
 	OptionOps = option_ops(short_option, long_option,
 		option_defaults, special_handler),
-	getopt__process_options(OptionOps, Args0, OptionArgs, Args, Result).
+	getopt_io__process_options(OptionOps, Args0, OptionArgs, Args, Result,
+		!IO).
 
 :- pred dump_arguments(list(string)::in, io::di, io::uo) is det.
 
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.344
diff -u -b -r1.344 hlds_out.m
--- compiler/hlds_out.m	21 Jan 2005 06:20:38 -0000	1.344
+++ compiler/hlds_out.m	23 Jan 2005 05:30:55 -0000
@@ -280,7 +280,7 @@
 
 % Standard library modules
 :- import_module int, string, set, assoc_list, map, multi_map.
-:- import_module require, getopt, std_util, term_io, varset.
+:- import_module require, getopt_io, std_util, term_io, varset.
 
 hlds_out__write_type_ctor(Name - Arity, !IO) :-
 	prog_out__write_sym_name_and_arity(Name / Arity, !IO).
Index: compiler/ilasm.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ilasm.m,v
retrieving revision 1.39
diff -u -b -r1.39 ilasm.m
--- compiler/ilasm.m	30 Jun 2004 02:48:02 -0000	1.39
+++ compiler/ilasm.m	23 Jan 2005 05:30:59 -0000
@@ -276,7 +276,7 @@
 :- import_module libs__options.
 :- import_module parse_tree__error_util.
 
-:- import_module char, string, pprint, getopt.
+:- import_module char, string, pprint, getopt_io.
 :- import_module require, int, term_io, varset, bool.
 
 	% Some versions of the IL assembler enforce a rule that if you output
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.165
diff -u -b -r1.165 intermod.m
--- compiler/intermod.m	21 Jan 2005 06:20:39 -0000	1.165
+++ compiler/intermod.m	23 Jan 2005 05:31:43 -0000
@@ -109,8 +109,10 @@
 :- import_module parse_tree__prog_util.
 :- import_module transform_hlds__inlining.
 
-:- import_module assoc_list, dir, getopt, int, list, map, multi_map, require.
-:- import_module set, std_util, string, term, varset.
+:- import_module int, string, list, assoc_list.
+:- import_module map, multi_map, set.
+:- import_module dir, getopt_io, require.
+:- import_module std_util, term, varset.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/make.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.m,v
retrieving revision 1.23
diff -u -b -r1.23 make.m
--- compiler/make.m	19 Jan 2005 03:10:39 -0000	1.23
+++ compiler/make.m	23 Jan 2005 05:31:47 -0000
@@ -77,7 +77,7 @@
 :- import_module parse_tree__prog_out.
 :- import_module top_level__mercury_compile. % XXX unwanted dependency
 
-:- import_module assoc_list, bool, char, dir, exception, getopt, int, list.
+:- import_module assoc_list, bool, char, dir, exception, getopt_io, int, list.
 :- import_module map, parser, require, set, std_util, string, term, term_io.
 
 :- type make_info
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.494
diff -u -b -r1.494 make_hlds.m
--- compiler/make_hlds.m	21 Jan 2005 06:20:41 -0000	1.494
+++ compiler/make_hlds.m	23 Jan 2005 05:31:52 -0000
@@ -137,7 +137,7 @@
 :- import_module transform_hlds__term_util.
 
 :- import_module string, char, int, set, map, multi_map, require.
-:- import_module bag, term, varset, getopt, assoc_list, term_io.
+:- import_module bag, term, varset, getopt_io, assoc_list, term_io.
 
 parse_tree_to_hlds(module(Name, Items), MQInfo0, EqvMap, Module, QualInfo,
 		InvalidTypes, InvalidModes, !IO) :-
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.322
diff -u -b -r1.322 mercury_compile.m
--- compiler/mercury_compile.m	21 Jan 2005 06:20:42 -0000	1.322
+++ compiler/mercury_compile.m	23 Jan 2005 05:31:56 -0000
@@ -167,7 +167,7 @@
 
 	% library modules
 :- import_module int, list, map, set, std_util, require, string, bool, dir.
-:- import_module library, getopt, term, varset, assoc_list.
+:- import_module library, getopt_io, term, varset, assoc_list.
 :- import_module gc, benchmarking.
 :- import_module pprint.
 
@@ -195,7 +195,8 @@
 		options_file__read_args_file(ArgFile, MaybeArgs1, !IO),
 		(
 			MaybeArgs1 = yes(Args1),
-			process_options(Args1, OptionArgs, NonOptionArgs, _),
+			process_options(Args1, OptionArgs, NonOptionArgs, _,
+				!IO),
 			MaybeMCFlags = yes([])
 		;
 			MaybeArgs1 = no,
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.314
diff -u -b -r1.314 modules.m
--- compiler/modules.m	21 Jan 2005 04:45:49 -0000	1.314
+++ compiler/modules.m	23 Jan 2005 05:38:14 -0000
@@ -786,7 +786,7 @@
 
 :- import_module string, map, term, varset, dir, library.
 :- import_module assoc_list, relation, char, require.
-:- import_module getopt, multi_map, sparse_bitset, svset.
+:- import_module getopt_io, multi_map, sparse_bitset, svset.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.440
diff -u -b -r1.440 options.m
--- compiler/options.m	22 Jan 2005 06:10:53 -0000	1.440
+++ compiler/options.m	24 Jan 2005 02:15:16 -0000
@@ -7,7 +7,7 @@
 % File: options.m.
 % Main author: fjh.
 
-% This defines the stuff necessary so that getopt.m
+% This defines the stuff necessary so that getopt_io.m
 % can parse the command-line options.
 
 % IMPORTANT NOTE: any changes to the options should be
@@ -19,7 +19,7 @@
 :- module libs__options.
 :- interface.
 
-:- import_module char, io, getopt.
+:- import_module char, io, getopt_io.
 
 :- pred short_option(char::in, option::out) is semidet.
 :- pred long_option(string::in, option::out) is semidet.
@@ -2217,7 +2217,7 @@
 append_to_accumulating_option(Option - Value, OptionTable0) =
 	OptionTable0 ^ elem(Option) :=
 	    accumulating(
-		getopt__lookup_accumulating_option(OptionTable0, Option)
+		getopt_io__lookup_accumulating_option(OptionTable0, Option)
 		++ [Value]).
 
 :- pred set_opt_level(int, option_table, option_table).
@@ -2313,7 +2313,7 @@
 	optimize_tailcalls	-	bool(yes)
 	% dups?
 ]) :-
-	getopt__lookup_bool_option(OptionTable, have_delay_slot, DelaySlot).
+	getopt_io__lookup_bool_option(OptionTable, have_delay_slot, DelaySlot).
 
 % Optimization level 2: apply optimizations which have a good
 % payoff relative to their cost; but include optimizations
Index: compiler/rl_out.pp
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_out.pp,v
retrieving revision 1.25
diff -u -b -r1.25 rl_out.pp
--- compiler/rl_out.pp	21 Jan 2005 06:20:47 -0000	1.25
+++ compiler/rl_out.pp	23 Jan 2005 12:39:28 -0000
@@ -84,7 +84,7 @@
 #else
 #endif
 
-:- import_module getopt.
+:- import_module getopt_io.
 :- import_module assoc_list, bool, char, int, map, multi_map, require, set.
 :- import_module string, term, libs__tree, varset.
 
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.362
diff -u -b -r1.362 typecheck.m
--- compiler/typecheck.m	21 Jan 2005 06:20:48 -0000	1.362
+++ compiler/typecheck.m	23 Jan 2005 05:32:08 -0000
@@ -152,7 +152,7 @@
 :- import_module parse_tree__prog_util.
 :- import_module parse_tree__prog_type.
 
-:- import_module getopt.
+:- import_module getopt_io.
 :- import_module int, set, string, require, multi_map.
 :- import_module assoc_list, std_util, term, varset, term_io.
 
Index: compiler/var_locn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/var_locn.m,v
retrieving revision 1.22
diff -u -b -r1.22 var_locn.m
--- compiler/var_locn.m	28 Sep 2004 02:08:23 -0000	1.22
+++ compiler/var_locn.m	23 Jan 2005 05:32:11 -0000
@@ -333,7 +333,7 @@
 :- import_module ll_backend__exprn_aux.
 :- import_module parse_tree__error_util.
 
-:- import_module int, string, bag, require, getopt, varset, term.
+:- import_module int, string, bag, require, getopt_io, varset, term.
 
 :- type dead_or_alive	--->	dead ; alive.
 
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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