Clean up the handling of the exit status in the compiler.

Estimated hours taken: 0.5
Branches: main

Clean up the handling of the exit status in the compiler.
This doesn't fix any known bugs, but may prevent new ones.

compiler/passes_aux.m:
	Don't set the exit status to 1 if a system command fails. That
	should be done by a caller if the failed command means that the
	compilation as a whole fails.

	Add a predicate maybe_set_exit_status to set the exit status
	to 1 if the boolean argument representing the success or failure
	of a command is `no'.

compiler/compile_target_code.m:
	Don't set the exit status if a compilation fails -- leave
	that the mercury_compile.m.

compiler/mercury_compile.m:
	Call maybe_set_exit_status to check the result of target
	code compilations.
This commit is contained in:
Simon Taylor
2002-06-26 08:31:26 +00:00
parent 571e3318a1
commit 33ee37095c
3 changed files with 20 additions and 10 deletions

View File

@@ -688,7 +688,6 @@ make_init_file(ErrorStream, MainModuleName, AllModules, Succeeded) -->
io__nl(ErrorStream),
io__write_string(ErrorStream, io__error_message(Error)),
io__nl(ErrorStream),
io__set_exit_status(1),
{ Succeeded = no }
)
).
@@ -1065,8 +1064,7 @@ write_num_split_c_files(ModuleName, NumChunks, Succeeded) -->
io__write_string(ProgName),
io__write_string(": can't open `"),
io__write_string(NumChunksFileName),
io__write_string("' for output\n"),
io__set_exit_status(1)
io__write_string("' for output\n")
).
read_num_split_c_files(ModuleName, MaybeNumChunks) -->