mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 23:05:21 +00:00
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:
@@ -309,7 +309,8 @@ build_target(CompilationTask, TargetFile, Imports, TouchedTargetFiles,
|
|||||||
TargetFile = ModuleName - _FileType,
|
TargetFile = ModuleName - _FileType,
|
||||||
CompilationTask = Task - TaskOptions,
|
CompilationTask = Task - TaskOptions,
|
||||||
(
|
(
|
||||||
CompilationTask = process_module(compile_to_target_code) - _,
|
CompilationTask = process_module(ModuleTask) - _,
|
||||||
|
forkable_module_compilation_task_type(ModuleTask),
|
||||||
\+ can_fork
|
\+ can_fork
|
||||||
->
|
->
|
||||||
% We need a temporary file to pass the arguments to
|
% 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.
|
% it can be difficult to kill the compiler otherwise.
|
||||||
io.set_output_stream(ErrorStream, OldOutputStream, !IO),
|
io.set_output_stream(ErrorStream, OldOutputStream, !IO),
|
||||||
(
|
(
|
||||||
(ModuleTask = compile_to_target_code
|
forkable_module_compilation_task_type(ModuleTask)
|
||||||
; ModuleTask = make_optimization_interface
|
|
||||||
; ModuleTask = make_analysis_registry)
|
|
||||||
->
|
->
|
||||||
call_in_forked_process(call_mercury_compile_main([ModuleArg]),
|
call_in_forked_process(call_mercury_compile_main([ModuleArg]),
|
||||||
invoke_mmc(ErrorStream, ArgFileName, AllOptionArgs ++ [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,
|
compile_target_code.compile_csharp_file(ErrorStream, Imports,
|
||||||
CSharpFile, DLLFile, Succeeded, !IO).
|
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,
|
:- pred foreign_code_file(module_name::in, pic::in, foreign_language::in,
|
||||||
|
|||||||
Reference in New Issue
Block a user