Fix an inconsistency which prevented `mmc --make' from being able to

Estimated hours taken: 0.2
Branches: main, release

compiler/make.module_target.m:
	Fix an inconsistency which prevented `mmc --make' from being able to
	make `.opt' or `.analysis' files on platforms/grades where `mmc
	--make' is unable to fork().
This commit is contained in:
Peter Wang
2006-04-03 13:20:10 +00:00
parent 749c6da9c7
commit ad75e65dec

View File

@@ -309,7 +309,8 @@ build_target(CompilationTask, TargetFile, Imports, TouchedTargetFiles,
TargetFile = ModuleName - _FileType,
CompilationTask = Task - TaskOptions,
(
CompilationTask = process_module(compile_to_target_code) - _,
CompilationTask = process_module(ModuleTask) - _,
forkable_module_compilation_task_type(ModuleTask),
\+ can_fork
->
% We need a temporary file to pass the arguments to
@@ -378,9 +379,7 @@ build_target_2(ModuleName, process_module(ModuleTask), ArgFileName,
% it can be difficult to kill the compiler otherwise.
io.set_output_stream(ErrorStream, OldOutputStream, !IO),
(
(ModuleTask = compile_to_target_code
; ModuleTask = make_optimization_interface
; ModuleTask = make_analysis_registry)
forkable_module_compilation_task_type(ModuleTask)
->
call_in_forked_process(call_mercury_compile_main([ModuleArg]),
invoke_mmc(ErrorStream, ArgFileName, AllOptionArgs ++ [ModuleArg]),
@@ -483,6 +482,13 @@ compile_foreign_code_file(ErrorStream, _, Imports,
compile_target_code.compile_csharp_file(ErrorStream, Imports,
CSharpFile, DLLFile, Succeeded, !IO).
:- pred forkable_module_compilation_task_type(module_compilation_task_type::in)
is semidet.
forkable_module_compilation_task_type(compile_to_target_code).
forkable_module_compilation_task_type(make_optimization_interface).
forkable_module_compilation_task_type(make_analysis_registry).
%-----------------------------------------------------------------------------%
:- pred foreign_code_file(module_name::in, pic::in, foreign_language::in,