Commit 546c3fe6 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

move processor setting from codegen opts to environment;

imporoved error messages so that crashes are recognised as errors;
put macintosh temp files in temp dir;
processor dependant object names;
parent f3bdef18
...@@ -169,6 +169,7 @@ getCurrentLink :: !*(PSt *General) -> (!String,!*PSt *General) ...@@ -169,6 +169,7 @@ getCurrentLink :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General) getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General) getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General)
getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General) getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General) getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
//-- error window stuff //-- error window stuff
......
...@@ -447,6 +447,11 @@ getCurrentRedc ps ...@@ -447,6 +447,11 @@ getCurrentRedc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps # (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.target_redc,ps) = (ct.target_redc,ps)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentProc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.target_proc,ps)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General) getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
getCurrentMeth ps getCurrentMeth ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps # (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
......
...@@ -619,7 +619,12 @@ toolpane tg compId cgenId linkId dynlId versId methId ...@@ -619,7 +619,12 @@ toolpane tg compId cgenId linkId dynlId versId methId
[ ControlId versId [ ControlId versId
, ControlActivate (noLS (appPIO (setEditControlSelection versId 1 0))) , ControlActivate (noLS (appPIO (setEditControlSelection versId 1 0)))
] ]
:+: CheckControl [("Console in IDE",Nothing,toMark tg.target_redc,redcfun)] (Columns 1) [ControlPos (Left,zero)] :+: PlatformDependant
( CheckControl [("Console in IDE",Nothing,toMark tg.target_redc,redcfun)] (Columns 1) [ControlPos (Left,zero)])
( TextControl "Processor: " [ControlPos (Left,zero), ControlWidth textWidth]
:+: PopUpControl
[(toString p,procfun p) \\ p <- PlatformProcessors]
(proc2idx tg.target_proc) [])
:+: RadioControl :+: RadioControl
[("Sync",Nothing,methfun 1) [("Sync",Nothing,methfun 1)
,("Async",Nothing,methfun 2) ,("Async",Nothing,methfun 2)
...@@ -651,6 +656,15 @@ where ...@@ -651,6 +656,15 @@ where
# ls = {ls & tg.target_redc = not ls.tg.target_redc} # ls = {ls & tg.target_redc = not ls.tg.target_redc}
= (ls,ps) = (ls,ps)
procfun proc (ls,ps)
# ls = {ls & tg.target_proc = proc}
= (ls,ps)
proc2idx proc
= case [x \\ p <- PlatformProcessors & x <- [1..] | p == proc] of
[] -> proc2idx DefaultProcessor
[x:_] -> x
methfun 1 (ls,ps) methfun 1 (ls,ps)
# ps = appPIO (disableControl methId) ps # ps = appPIO (disableControl methId) ps
# ls = {ls & tg.target_meth = CompileSync} # ls = {ls & tg.target_meth = CompileSync}
......
...@@ -70,6 +70,7 @@ CodeGen :: // Generates code for the given file: ...@@ -70,6 +70,7 @@ CodeGen :: // Generates code for the given file:
!Pathname // full .abc pathname of module to be compiled !Pathname // full .abc pathname of module to be compiled
!Bool // timeprofiling option !Bool // timeprofiling option
!CodeGenOptions // code generator options !CodeGenOptions // code generator options
!Processor // target processor
!ApplicationOptions // application options !ApplicationOptions // application options
!Pathname // startup directory !Pathname // startup directory
!*(PSt .l) // state !*(PSt .l) // state
...@@ -82,7 +83,23 @@ CodeGen :: // Generates code for the given file: ...@@ -82,7 +83,23 @@ CodeGen :: // Generates code for the given file:
, !Bool // success status , !Bool // success status
) )
StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) -> (!Bool,!Pathname,!*(PSt .l)) StartCodeGenerator ::
!String
!(WindowFun *(PSt .l))
!CodeGenerateAsmOrCode
!Pathname
!Int
!Bool
!CodeGenOptions
!Processor
!ApplicationOptions
!Pathname
!*(PSt .l)
->
( !Bool
, !Pathname
, !*(PSt .l)
)
Link :: // Links the given file: Link :: // Links the given file:
!String // linker exe name !String // linker exe name
...@@ -103,6 +120,7 @@ Link :: // Links the given file: ...@@ -103,6 +120,7 @@ Link :: // Links the given file:
!Bool // generate dll? !Bool // generate dll?
!String // name of file containing symbols to be exported from dll !String // name of file containing symbols to be exported from dll
!Pathname // startup directory !Pathname // startup directory
!String // dynamic linker name
!Bool // add 'carb' 0 resource? !Bool // add 'carb' 0 resource?
!*(PSt .l) // state !*(PSt .l) // state
-> ->
......
...@@ -64,6 +64,7 @@ standardObjectFiles stack_traces profiling processor ...@@ -64,6 +64,7 @@ standardObjectFiles stack_traces profiling processor
= ( MakeObjPathname processor "_startupTrace" :! rest) = ( MakeObjPathname processor "_startupTrace" :! rest)
| profiling | profiling
= ( MakeObjPathname processor "_startupProfile" :! rest) = ( MakeObjPathname processor "_startupProfile" :! rest)
// otherwise
= ( MakeObjPathname processor "_startup" :! rest) = ( MakeObjPathname processor "_startup" :! rest)
where where
rest rest
...@@ -73,6 +74,7 @@ where ...@@ -73,6 +74,7 @@ where
:! MakeObjPathname processor "_system" :! MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library" :! MakeObjPathname processor "_library"
:! Nil :! Nil
// otherwise
= MakeObjPathname processor "_system" = MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library" :! MakeObjPathname processor "_library"
:! Nil :! Nil
...@@ -150,11 +152,13 @@ where ...@@ -150,11 +152,13 @@ where
out_file_path :: String Int -> String out_file_path :: String Int -> String
out_file_path startupdir slot out_file_path startupdir slot
= file_path startupdir "out" slot // = file_path startupdir "out" slot
= file_path TempDir "out" slot
errors_file_path :: String Int -> String errors_file_path :: String Int -> String
errors_file_path startupdir slot errors_file_path startupdir slot
= file_path startupdir "errors" slot // = file_path startupdir "errors" slot
= file_path TempDir "errors" slot
file_path :: String String Int -> String file_path :: String String Int -> String
file_path startupdir base_name slot file_path startupdir base_name slot
...@@ -179,7 +183,7 @@ Compile cocl` write_module_times errwin typewin compileOrCheckSyntax path paths ...@@ -179,7 +183,7 @@ Compile cocl` write_module_times errwin typewin compileOrCheckSyntax path paths
// # name = CleanCompilerName // XOXOXOX // # name = CleanCompilerName // XOXOXOX
# (error_code,error_n,ss) = send_command_to_clean_compiler_cc signature name command Wait # (error_code,error_n,ss) = send_command_to_clean_compiler_cc signature name command Wait
| error_code <> 0 = | error_code <> 0 =
( errwin ( [ "Unable to run compiler: "+++cocl ( errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code +++ "; "+++ toString error_code
+++ "; "+++ toString error_n +++ "; "+++ toString error_n
+++ "; "+++ ss +++ "; "+++ ss
...@@ -372,9 +376,9 @@ SwitchDebugMachO tp symbolic_machO normal :== case toString tp of ...@@ -372,9 +376,9 @@ SwitchDebugMachO tp symbolic_machO normal :== case toString tp of
// "PowerPC_MachO" -> symbolic_machO // "PowerPC_MachO" -> symbolic_machO
_ -> normal _ -> normal
CodeGen :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) CodeGen :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Bool !CodeGenOptions !Processor !ApplicationOptions !Pathname !*(PSt .l)
-> (!*(PSt .l), !Pathname, !Bool) -> (!*(PSt .l), !Pathname, !Bool)
CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps CodeGen cgen` wf genAsmOrCode path timeprofile cgo tp ao startupdir ps
# genAsmOrCode` = SwitchDebugMachO tp AsmGeneration genAsmOrCode # genAsmOrCode` = SwitchDebugMachO tp AsmGeneration genAsmOrCode
# (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir # (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir
...@@ -384,14 +388,18 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -384,14 +388,18 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
# objpath = MakeObjSystemPathname tp path # objpath = MakeObjSystemPathname tp path
path_without_suffix = RemoveSuffix path path_without_suffix = RemoveSuffix path
out_file_name
= out_file_path startupdir 0
errors_file_name
= errors_file_path startupdir 0
command = cgen +++ MakeCodeGenOptionsString genAsmOrCode` timeprofile cgo command = cgen +++ MakeCodeGenOptionsString genAsmOrCode` timeprofile cgo
+++ " " +++ (quoted_string path_without_suffix) +++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors" +++ " > " +++ quoted_string out_file_name
errorsfilename = startupdir +++ toString dirseparator +++ "errors" +++ " \xb3 " +++ quoted_string errors_file_name
# (error_code,error_n,output_string) # (error_code,error_n,output_string)
= send_command_to_clean_compiler_cg signature name command Wait = send_command_to_clean_compiler_cg signature name command Wait
| error_code <> 0 | error_code <> 0
= ( wf ( [ "Unable to run code generator: "+++toString error_code = ( wf ( [ "Error: Unable to run code generator: "+++toString error_code
]) ps ]) ps
, objpath , objpath
, False , False
...@@ -405,7 +413,7 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -405,7 +413,7 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
) )
| error_n <> 0 | error_n <> 0
= ( wf ( [ "Code generator: "+++toString error_n = ( wf ( [ "Error: Code generator: "+++toString error_n
]) ps ]) ps
, objpath , objpath
, False , False
...@@ -429,28 +437,31 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -429,28 +437,31 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
) )
(ps,objpath,True) (ps,objpath,True)
StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !Processor !ApplicationOptions !Pathname !*(PSt .l)
-> (!Bool,!Pathname,!*(PSt .l)) -> (!Bool,!Pathname,!*(PSt .l))
StartCodeGenerator cgen` wf genAsmOrCode path slot timeprofile cgo=:{tp} ao startupdir ps StartCodeGenerator cgen` wf genAsmOrCode path slot timeprofile cgo tp ao startupdir ps
# (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir # (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir
| not cgen_ok | not cgen_ok
# ps = wf [cgen] ps # ps = wf [cgen] ps
= (False, "", ps) = (False, "", ps)
// # (objpath,ps) = accFiles (MakeObjSystemPathname tp path) ps
# objpath = MakeObjSystemPathname tp path # objpath = MakeObjSystemPathname tp path
path_without_suffix = RemoveSuffix path path_without_suffix = RemoveSuffix path
// errorsfilename = errors_file_path startupdir slot out_file_name
= out_file_path startupdir 0
errors_file_name
= errors_file_path startupdir 0
command = /*cgen*/ "cg" command = /*cgen*/ "cg"
+++" -id "+++toString slot +++" -id "+++toString slot
+++ MakeCodeGenOptionsString genAsmOrCode /*False*/timeprofile cgo +++ MakeCodeGenOptionsString genAsmOrCode /*False*/timeprofile cgo
+++ " " +++ (quoted_string path_without_suffix) +++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors" +++ " > " +++ quoted_string out_file_name
+++ " \xb3 " +++ quoted_string errors_file_name
name = CleanCompilerName name = CleanCompilerName
signature = clean_compiler_signature slot signature = clean_compiler_signature slot
(error_code,error_n,output_string) = send_command_to_clean_compiler signature name command NoWait (error_code,error_n,output_string) = send_command_to_clean_compiler signature name command NoWait
| error_code<>0 | error_code<>0
# ps = wf ["Unable to run code generator: "+++toString error_code] ps # ps = wf ["Error: Unable to run code generator: "+++toString error_code] ps
= (False,objpath,ps) = (False,objpath,ps)
| size output_string <> 0 | size output_string <> 0
# ps = wf [output_string] ps # ps = wf [output_string] ps
...@@ -472,13 +483,13 @@ where ...@@ -472,13 +483,13 @@ where
Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool
!Bool !Bool !Bool !String !Bool !String !Pathname !Bool !*(PSt .l) !Bool !Bool !Bool !String !Bool !String !Pathname !String !Bool !*(PSt .l)
-> (!*(PSt .l),!Bool) -> (!*(PSt .l),!Bool)
Link linker` winfun path Link linker` winfun path
applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap} applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names optionspathname library_file_names object_file_names
static_libraries static gen_relocs gen_linkmap static_libraries static gen_relocs gen_linkmap
link_resources resource_path gen_dll dll_names startupdir add_carb_resource ps link_resources resource_path gen_dll dll_names startupdir dynlinker add_carb_resource ps
# (ok,linker) = mangleLinker linker` startupdir # (ok,linker) = mangleLinker linker` startupdir
| not ok | not ok
# ps = winfun [linker] ps # ps = winfun [linker] ps
...@@ -980,7 +991,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path pat ...@@ -980,7 +991,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path pat
# signature = clean_compiler_signature slot # signature = clean_compiler_signature slot
# (error_code,error_n,ss) = trace_n command send_command_to_clean_compiler signature name command NoWait # (error_code,error_n,ss) = trace_n command send_command_to_clean_compiler signature name command NoWait
| error_code <> 0 | error_code <> 0
= ( False, errwin ( [ "Unable to run compiler: "+++cocl = ( False, errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code +++ "; "+++ toString error_code
+++ "; "+++ toString error_n +++ "; "+++ toString error_n
+++ "; "+++ ss +++ "; "+++ ss
...@@ -1088,7 +1099,7 @@ CompilePersistent :: ...@@ -1088,7 +1099,7 @@ CompilePersistent ::
| FileEnv env | FileEnv env
CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling projectTimeProfiling CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling projectTimeProfiling
projectEagerOrDynamic compileroptions startupdir state env projectEagerOrDynamic compileroptions startupdir state env
= (state,(errwin ["Persistent not supported."] env,"",SyntaxError)) = (state,(errwin ["Error: Persistent not supported."] env,"",SyntaxError))
// ... JVG // ... JVG
//-- //--
...@@ -1110,8 +1121,8 @@ mangleCompiler ccstring startupdir ...@@ -1110,8 +1121,8 @@ mangleCompiler ccstring startupdir
# (name,rest) = sSplit ';' ccstring # (name,rest) = sSplit ';' ccstring
# (sign,cocl) = sSplit ';' rest # (sign,cocl) = sSplit ';' rest
# name = case name of # name = case name of
"" -> "Clean Compiler"//\0" "" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> n n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of # sign = case sign of
"" -> "ClCo"//\0" "" -> "ClCo"//\0"
s -> s s -> s
...@@ -1133,8 +1144,8 @@ mangleGenerator cgstring startupdir ...@@ -1133,8 +1144,8 @@ mangleGenerator cgstring startupdir
# (name,rest) = sSplit ';' cgstring # (name,rest) = sSplit ';' cgstring
# (sign,cgen) = sSplit ';' rest # (sign,cgen) = sSplit ';' rest
# name = case name of # name = case name of
"" -> "Clean Compiler"//\0" "" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> n n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of # sign = case sign of
"" -> "ClCo"//\0" "" -> "ClCo"//\0"
s -> s s -> s
......
...@@ -23,7 +23,7 @@ import PmFileInfo ...@@ -23,7 +23,7 @@ import PmFileInfo
import PmDirCache import PmDirCache
import interrupt,Platform import interrupt,Platform
from Directory import :: DateTime(..), :: Date`(..), :: Time`(..) from Directory import :: Date`(..), :: Time`(..)
//from dodebug import trace_n` //from dodebug import trace_n`
trace_n _ g :== g trace_n _ g :== g
...@@ -203,9 +203,9 @@ MakeTheProject force fileinfo libsinfo abccache project continue ps ...@@ -203,9 +203,9 @@ MakeTheProject force fileinfo libsinfo abccache project continue ps
# (method,ps) = getCurrentMeth ps # (method,ps) = getCurrentMeth ps
# compinfo = case method of # compinfo = case method of
CompileSync -> Sync CompileSync -> Sync
// (CompileAsync cmax) -> PlatformDependant (CompileAsync cmax) -> PlatformDependant
// (AsyncWin cmax []) // win (AsyncWin cmax []) // win
// (Async [] cmax 0 NoUnknownFinishedProcessors) // mac (Async [] cmax 0 NoUnknownFinishedProcessors) // mac
CompilePers -> Pers InitCompilingInfo CompilePers -> Pers InitCompilingInfo
# ds = # ds =
{ project = project { project = project
...@@ -326,7 +326,7 @@ step intr (DComp force dircache compinfo=:(Pers _) (next :! rest) ds) ps ...@@ -326,7 +326,7 @@ step intr (DComp force dircache compinfo=:(Pers _) (next :! rest) ds) ps
= step intr (DGene paths SyncCodeGeneration ds) ps = step intr (DGene paths SyncCodeGeneration ds) ps
# ds = {ds & modpaths = next :! ds.modpaths} # ds = {ds & modpaths = next :! ds.modpaths}
= cont (DComp force dircache compinfo rest ds,ps) = cont (DComp force dircache compinfo rest ds,ps)
/*
step intr (DComp force dircache (Async [] max_n_processes n_used_processors NoUnknownFinishedProcessors) Nil ds) ps step intr (DComp force dircache (Async [] max_n_processes n_used_processors NoUnknownFinishedProcessors) Nil ds) ps
// compile phase finished: remove all modules not (indirectly) imported by main module // compile phase finished: remove all modules not (indirectly) imported by main module
# project = PR_SetBuilt ds.modpaths ds.project // removes unused modules # project = PR_SetBuilt ds.modpaths ds.project // removes unused modules
...@@ -336,7 +336,7 @@ step intr (DComp force dircache (Async [] max_n_processes n_used_processors NoUn ...@@ -336,7 +336,7 @@ step intr (DComp force dircache (Async [] max_n_processes n_used_processors NoUn
# ps = showInfo (Level1 "Generating...") ps # ps = showInfo (Level1 "Generating...") ps
# (paths,ds) = ds!modpaths # (paths,ds) = ds!modpaths
= step intr (DGene paths (ASyncCodeGeneration [] max_n_processes NoUnknownFinishedProcessors) ds) ps = step intr (DGene paths (ASyncCodeGeneration [] max_n_processes NoUnknownFinishedProcessors) ds) ps
/*
step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps
// compile phase finished: remove all modules not (indirectly) imported by main module // compile phase finished: remove all modules not (indirectly) imported by main module
# project = PR_SetBuilt ds.modpaths ds.project // removes unused modules # project = PR_SetBuilt ds.modpaths ds.project // removes unused modules
...@@ -346,7 +346,7 @@ step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps ...@@ -346,7 +346,7 @@ step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps
# ps = showInfo (Level1 "Generating...") ps # ps = showInfo (Level1 "Generating...") ps
# (paths,ds) = ds!modpaths # (paths,ds) = ds!modpaths
= step intr (DGene paths SyncCodeGeneration ds) ps = step intr (DGene paths SyncCodeGeneration ds) ps
*/
step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps
# ps = traceInfo (Level3 ["check_completed..."]) ps # ps = traceInfo (Level3 ["check_completed..."]) ps
# (state, ps) = check_completed state ps # (state, ps) = check_completed state ps
...@@ -451,6 +451,7 @@ step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps ...@@ -451,6 +451,7 @@ step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps
currently_compiled next current currently_compiled next current
= or [c.iclModule == next \\ c <- current] = or [c.iclModule == next \\ c <- current]
/*XXX
step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps
# ps = traceInfo (Level3 ["check_completed..."]) ps # ps = traceInfo (Level3 ["check_completed..."]) ps
# (state, ps) = check_completed state ps # (state, ps) = check_completed state ps
...@@ -527,11 +528,11 @@ step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps ...@@ -527,11 +528,11 @@ step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps
step intr (DGene Nil SyncCodeGeneration ds) ps step intr (DGene Nil SyncCodeGeneration ds) ps
#! ps = showInfo (Level1 "Linking...") ps #! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps = step intr (DLink ds) ps
/*
step intr (DGene Nil (ASyncCodeGeneration [] _ NoUnknownFinishedProcessors) ds) ps step intr (DGene Nil (ASyncCodeGeneration [] _ NoUnknownFinishedProcessors) ds) ps
#! ps = showInfo (Level1 "Linking...") ps #! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps = step intr (DLink ds) ps
*/
step intr (DGene (path:!rest) SyncCodeGeneration ds) ps step intr (DGene (path:!rest) SyncCodeGeneration ds) ps
| not ds.ok || intr | not ds.ok || intr
# ds = {ds & ok = False} # ds = {ds & ok = False}
...@@ -542,7 +543,7 @@ step intr (DGene (path:!rest) SyncCodeGeneration ds) ps ...@@ -542,7 +543,7 @@ step intr (DGene (path:!rest) SyncCodeGeneration ds) ps
| not ok | not ok
= step intr (DLink ds) ps = step intr (DLink ds) ps
= cont (DGene rest SyncCodeGeneration ds, ps) = cont (DGene rest SyncCodeGeneration ds, ps)
/*
step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unknown_finished_processors) ds) ps step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unknown_finished_processors) ds) ps
# (ok,busy_processes,unknown_finished_processors,project,fileinfo,ps) # (ok,busy_processes,unknown_finished_processors,project,fileinfo,ps)
= handle_finished_code_generators busy_processes unknown_finished_processors ds.project ds.fileinfo ps = handle_finished_code_generators busy_processes unknown_finished_processors ds.project ds.fileinfo ps
...@@ -617,8 +618,9 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno ...@@ -617,8 +618,9 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno
# (ps,abccache,fileinfo,gen,abc_path) # (ps,abccache,fileinfo,gen,abc_path)
= CheckABCOutOfDate False path abccache fileinfo project ps = CheckABCOutOfDate False path abccache fileinfo project ps
# cgo = PR_GetCodeGenOptions project # cgo = PR_GetCodeGenOptions project
# (proc,ps) = getCurrentProc ps
# ((abccache,fileinfo,info), ps) # ((abccache,fileinfo,info), ps)
= FI_GetFileInfo cgo.tp abc_path abccache fileinfo ps = FI_GetFileInfo proc abc_path abccache fileinfo ps
| not gen | not gen
= start_code_generators rest busy_processes fileinfo abccache ps = start_code_generators rest busy_processes fileinfo abccache ps
# ps = showInfo (Level2 ( # ps = showInfo (Level2 (
...@@ -634,13 +636,13 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno ...@@ -634,13 +636,13 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno
# co = case (PR_GetModuleInfo modname project) of # co = case (PR_GetModuleInfo modname project) of
Just modinfo -> modinfo.compilerOptions Just modinfo -> modinfo.compilerOptions
_ -> defaultCO _ -> defaultCO
# tp = ao.profiling && (not co.neverTimeProfile) # timeprofile = ao.profiling && (not co.neverTimeProfile)
# free_slot = hd (removeMembers [0..max_n_processes-1] [slot \\ (slot,_,_) <- busy_processes]) # free_slot = hd (removeMembers [0..max_n_processes-1] [slot \\ (slot,_,_) <- busy_processes])
// # ps = trace ("code generator started "+++toString free_slot+++"\n") ps // # ps = trace ("code generator started "+++toString free_slot+++"\n") ps
// # ps = trace ("s "+++toString free_slot+++" ") ps // # ps = trace ("s "+++toString free_slot+++" ") ps
# (res,obj_path,ps) = StartCodeGenerator cgen updateErrorWindow CodeGeneration abc_path free_slot tp cgo ao startupdir ps # (res,obj_path,ps) = StartCodeGenerator cgen updateErrorWindow CodeGeneration abc_path free_slot timeprofile cgo proc ao startupdir ps
| not res | not res
= (False,rest,busy_processes,fileinfo,abccache,ps) = (False,rest,busy_processes,fileinfo,abccache,ps)
# busy_processes = [(free_slot,abc_path,obj_path):busy_processes] # busy_processes = [(free_slot,abc_path,obj_path):busy_processes]
...@@ -649,7 +651,7 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno ...@@ -649,7 +651,7 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno
= (True,Nil,busy_processes,fileinfo,abccache,ps) = (True,Nil,busy_processes,fileinfo,abccache,ps)
# ds = {ds & fileinfo = fileinfo, abccache = abccache, ok = ok} # ds = {ds & fileinfo = fileinfo, abccache = abccache, ok = ok}
= cont (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unknown_finished_processors) ds, ps) = cont (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unknown_finished_processors) ds, ps)
*/
step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, project, continue}) ps step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, project, continue}) ps
// Check whether executable is out of date and relink it if required. // Check whether executable is out of date and relink it if required.
| intr || not ok | intr || not ok
...@@ -674,7 +676,8 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj ...@@ -674,7 +676,8 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
# ao = PR_GetApplicationOptions project # ao = PR_GetApplicationOptions project
// possibly patch _system to correct profiling settings... // possibly patch _system to correct profiling settings...
# tp = PR_GetProcessor project // # tp = PR_GetProcessor project
# (tp,ps) = getCurrentProc ps
# ((abccache,fileinfo,modinfo),ps) # ((abccache,fileinfo,modinfo),ps)
= FI_GetFileInfo tp full_sys` abccache fileinfo ps = FI_GetFileInfo tp full_sys` abccache fileinfo ps