[m-rev.] for review: inconsistency in mmc --make code

Peter Wang wangp at students.cs.mu.OZ.AU
Mon Apr 3 16:37:24 AEST 2006


Estimated hours taken: 0.2
Branches: main

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().

Index: compiler/make.module_target.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.module_target.m,v
retrieving revision 1.39
diff -u -r1.39 make.module_target.m
--- compiler/make.module_target.m	17 Mar 2006 01:40:25 -0000	1.39
+++ compiler/make.module_target.m	3 Apr 2006 06:27:17 -0000
@@ -309,7 +309,8 @@
     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,10 +379,8 @@
     % 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]),
             Succeeded, !IO)
@@ -483,6 +482,13 @@
     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,
--------------------------------------------------------------------------
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