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

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)
getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General)
getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
//-- error window stuff
......
......@@ -447,6 +447,11 @@ getCurrentRedc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) 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 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
[ ControlId versId
, 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
[("Sync",Nothing,methfun 1)
,("Async",Nothing,methfun 2)
......@@ -651,6 +656,15 @@ where
# ls = {ls & tg.target_redc = not ls.tg.target_redc}
= (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)
# ps = appPIO (disableControl methId) ps
# ls = {ls & tg.target_meth = CompileSync}
......
......@@ -70,6 +70,7 @@ CodeGen :: // Generates code for the given file:
!Pathname // full .abc pathname of module to be compiled
!Bool // timeprofiling option
!CodeGenOptions // code generator options
!Processor // target processor
!ApplicationOptions // application options
!Pathname // startup directory
!*(PSt .l) // state
......@@ -82,7 +83,23 @@ CodeGen :: // Generates code for the given file:
, !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:
!String // linker exe name
......@@ -103,6 +120,7 @@ Link :: // Links the given file:
!Bool // generate dll?
!String // name of file containing symbols to be exported from dll
!Pathname // startup directory
!String // dynamic linker name
!Bool // add 'carb' 0 resource?
!*(PSt .l) // state
->
......
......@@ -64,6 +64,7 @@ standardObjectFiles stack_traces profiling processor
= ( MakeObjPathname processor "_startupTrace" :! rest)
| profiling
= ( MakeObjPathname processor "_startupProfile" :! rest)
// otherwise
= ( MakeObjPathname processor "_startup" :! rest)
where
rest
......@@ -73,6 +74,7 @@ where
:! MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library"
:! Nil
// otherwise
= MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library"
:! Nil
......@@ -150,11 +152,13 @@ where
out_file_path :: String Int -> String
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 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 startupdir base_name slot
......@@ -179,7 +183,7 @@ Compile cocl` write_module_times errwin typewin compileOrCheckSyntax path paths
// # name = CleanCompilerName // XOXOXOX
# (error_code,error_n,ss) = send_command_to_clean_compiler_cc signature name command Wait
| error_code <> 0 =
( errwin ( [ "Unable to run compiler: "+++cocl
( errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code
+++ "; "+++ toString error_n
+++ "; "+++ ss
......@@ -372,9 +376,9 @@ SwitchDebugMachO tp symbolic_machO normal :== case toString tp of
// "PowerPC_MachO" -> symbolic_machO
_ -> 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)
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
# (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir
......@@ -384,14 +388,18 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
# objpath = MakeObjSystemPathname tp 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
+++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors"
errorsfilename = startupdir +++ toString dirseparator +++ "errors"
+++ " > " +++ quoted_string out_file_name
+++ " \xb3 " +++ quoted_string errors_file_name
# (error_code,error_n,output_string)
= send_command_to_clean_compiler_cg signature name command Wait
| error_code <> 0
= ( wf ( [ "Unable to run code generator: "+++toString error_code
= ( wf ( [ "Error: Unable to run code generator: "+++toString error_code
]) ps
, objpath
, False
......@@ -405,7 +413,7 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
)
| error_n <> 0
= ( wf ( [ "Code generator: "+++toString error_n
= ( wf ( [ "Error: Code generator: "+++toString error_n
]) ps
, objpath
, False
......@@ -429,28 +437,31 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
)
(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))
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
| not cgen_ok
# ps = wf [cgen] ps
= (False, "", ps)
// # (objpath,ps) = accFiles (MakeObjSystemPathname tp path) ps
# objpath = MakeObjSystemPathname tp 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"
+++" -id "+++toString slot
+++ MakeCodeGenOptionsString genAsmOrCode /*False*/timeprofile cgo
+++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors"
+++ " > " +++ quoted_string out_file_name
+++ " \xb3 " +++ quoted_string errors_file_name
name = CleanCompilerName
signature = clean_compiler_signature slot
(error_code,error_n,output_string) = send_command_to_clean_compiler signature name command NoWait
| 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)
| size output_string <> 0
# ps = wf [output_string] ps
......@@ -472,13 +483,13 @@ where
Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions
!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)
Link linker` winfun path
applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names
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
| not ok
# ps = winfun [linker] ps
......@@ -980,7 +991,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path pat
# signature = clean_compiler_signature slot
# (error_code,error_n,ss) = trace_n command send_command_to_clean_compiler signature name command NoWait
| error_code <> 0
= ( False, errwin ( [ "Unable to run compiler: "+++cocl
= ( False, errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code
+++ "; "+++ toString error_n
+++ "; "+++ ss
......@@ -1088,7 +1099,7 @@ CompilePersistent ::
| FileEnv env
CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling projectTimeProfiling
projectEagerOrDynamic compileroptions startupdir state env
= (state,(errwin ["Persistent not supported."] env,"",SyntaxError))
= (state,(errwin ["Error: Persistent not supported."] env,"",SyntaxError))
// ... JVG
//--
......@@ -1110,8 +1121,8 @@ mangleCompiler ccstring startupdir
# (name,rest) = sSplit ';' ccstring
# (sign,cocl) = sSplit ';' rest
# name = case name of
"" -> "Clean Compiler"//\0"
n -> n
"" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of
"" -> "ClCo"//\0"
s -> s
......@@ -1133,8 +1144,8 @@ mangleGenerator cgstring startupdir
# (name,rest) = sSplit ';' cgstring
# (sign,cgen) = sSplit ';' rest
# name = case name of
"" -> "Clean Compiler"//\0"
n -> n
"" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of
"" -> "ClCo"//\0"
s -> s
......
......@@ -23,7 +23,7 @@ import PmFileInfo
import PmDirCache
import interrupt,Platform
from Directory import :: DateTime(..), :: Date`(..), :: Time`(..)
from Directory import :: Date`(..), :: Time`(..)
//from dodebug import trace_n`
trace_n _ g :== g
......@@ -203,9 +203,9 @@ MakeTheProject force fileinfo libsinfo abccache project continue ps
# (method,ps) = getCurrentMeth ps
# compinfo = case method of
CompileSync -> Sync
// (CompileAsync cmax) -> PlatformDependant
// (AsyncWin cmax []) // win
// (Async [] cmax 0 NoUnknownFinishedProcessors) // mac
(CompileAsync cmax) -> PlatformDependant
(AsyncWin cmax []) // win
(Async [] cmax 0 NoUnknownFinishedProcessors) // mac
CompilePers -> Pers InitCompilingInfo
# ds =
{ project = project
......@@ -326,7 +326,7 @@ step intr (DComp force dircache compinfo=:(Pers _) (next :! rest) ds) ps
= step intr (DGene paths SyncCodeGeneration ds) ps
# ds = {ds & modpaths = next :! ds.modpaths}
= cont (DComp force dircache compinfo rest 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
# 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
# ps = showInfo (Level1 "Generating...") ps
# (paths,ds) = ds!modpaths
= step intr (DGene paths (ASyncCodeGeneration [] max_n_processes NoUnknownFinishedProcessors) ds) ps
/*
step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps
// compile phase finished: remove all modules not (indirectly) imported by main module
# project = PR_SetBuilt ds.modpaths ds.project // removes unused modules
......@@ -346,7 +346,7 @@ step intr (DComp force dircache (AsyncWin _ []) Nil ds) ps
# ps = showInfo (Level1 "Generating...") ps
# (paths,ds) = ds!modpaths
= step intr (DGene paths SyncCodeGeneration ds) ps
*/
step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps
# ps = traceInfo (Level3 ["check_completed..."]) ps
# (state, ps) = check_completed state ps
......@@ -451,6 +451,7 @@ step intr state=:(DComp force _ (Async _ _ _ _) _ _) ps
currently_compiled next current
= or [c.iclModule == next \\ c <- current]
/*XXX
step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps
# ps = traceInfo (Level3 ["check_completed..."]) ps
# (state, ps) = check_completed state ps
......@@ -527,11 +528,11 @@ step intr state=:(DComp force dircache compinfo=:(AsyncWin _ _) rest ds) ps
step intr (DGene Nil SyncCodeGeneration ds) ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
/*
step intr (DGene Nil (ASyncCodeGeneration [] _ NoUnknownFinishedProcessors) ds) ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
*/
step intr (DGene (path:!rest) SyncCodeGeneration ds) ps
| not ds.ok || intr
# ds = {ds & ok = False}
......@@ -542,7 +543,7 @@ step intr (DGene (path:!rest) SyncCodeGeneration ds) ps
| not ok
= step intr (DLink ds) ps
= cont (DGene rest SyncCodeGeneration 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)
= 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
# (ps,abccache,fileinfo,gen,abc_path)
= CheckABCOutOfDate False path abccache fileinfo project ps
# cgo = PR_GetCodeGenOptions project
# (proc,ps) = getCurrentProc ps
# ((abccache,fileinfo,info), ps)
= FI_GetFileInfo cgo.tp abc_path abccache fileinfo ps
= FI_GetFileInfo proc abc_path abccache fileinfo ps
| not gen
= start_code_generators rest busy_processes fileinfo abccache ps
# ps = showInfo (Level2 (
......@@ -634,13 +636,13 @@ step intr (DGene paths (ASyncCodeGeneration busy_processes max_n_processes unkno
# co = case (PR_GetModuleInfo modname project) of
Just modinfo -> modinfo.compilerOptions
_ -> 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])
// # ps = trace ("code generator started "+++toString free_slot+++"\n") 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
= (False,rest,busy_processes,fileinfo,abccache,ps)
# 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
= (True,Nil,busy_processes,fileinfo,abccache,ps)
# ds = {ds & fileinfo = fileinfo, abccache = abccache, ok = ok}
= 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
// Check whether executable is out of date and relink it if required.
| intr || not ok
......@@ -674,7 +676,8 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
# ao = PR_GetApplicationOptions project
// possibly patch _system to correct profiling settings...
# tp = PR_GetProcessor project
// # tp = PR_GetProcessor project
# (tp,ps) = getCurrentProc ps
# ((abccache,fileinfo,modinfo),ps)
= FI_GetFileInfo tp full_sys` abccache fileinfo ps
......@@ -724,7 +727,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
// runtime objects and dynamic libs
# stdl = Concat sys_libs (standardStaticLibraries lo.method)
# stdo = Concat sys_objs (standardObjectFiles ao.stack_traces ao.profiling)
# stdo = Concat sys_objs (standardObjectFiles ao.stack_traces ao.profiling tp)
# (stdoOk,ofiles,abcPathsCache)
= case ao.standard_rte of
True -> GetPathNames stdo Nil abcPathsCache
......@@ -775,8 +778,14 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
// module imported objects and dynamic libs
# abcLinkInfo = PR_GetABCLinkInfo project
# linkObjFileNames = Map fix abcLinkInfo.linkObjFileNames
with
fix s
| s.[size s - 1] == '.'
= MakeObjPathname tp s
= s
# (objPathsOk,ofiles,abcPathsCache)
= GetPathNames abcLinkInfo.linkObjFileNames ofiles abcPathsCache
= GetPathNames linkObjFileNames ofiles abcPathsCache
# (_,ofiles`,abcPathsCache) = GetPathNames abcLinkInfo.linkObjFileNames ofiles` abcPathsCache
# (libPathsOk,lfiles,abcPathsCache)
= GetPathNames abcLinkInfo.linkLibraryNames lfiles abcPathsCache
......@@ -798,8 +807,15 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
*/
# loobjsOk = True
# lolibsOk = True
# ofiles = Concat lo.extraObjectModules ofiles
# ofiles` = Concat lo.extraObjectModules ofiles`
# extraObjectModules = lo.extraObjectModules
# extraObjectModules = Map fix extraObjectModules
with
fix s
| s.[size s - 1] == '.'
= MakeObjPathname tp s
= s
# ofiles = Concat extraObjectModules ofiles
# ofiles` = Concat extraObjectModules ofiles`
# lfiles = Concat lo.libraries lfiles
| not loobjsOk
......@@ -855,7 +871,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
// so: chache .exe date with used ao and lfiles,ofiles,sfiles dates...
// can imporve now by Younger checking all objects
# optionspath = MakeOptionsName prj_path
# optionspath = MakeOptionsName prj_path tp
# (dynlstr,ps) = getCurrentDynl ps
# (ps, ok) = Link linkstr updateErrorWindow execpath ao
optionspath lfiles ofiles sfiles
......@@ -866,7 +882,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
(fulPath app_path prj_path` lo.resource_source)
lo.generate_dll
(fulPath app_path prj_path` lo.dll_export_list_name)
startupdir dynlstr ps
startupdir dynlstr lo.add_carb_resource ps
# project = if ok (PR_SetLinked project) project
= continue ok False ok fileinfo libsinfo modpaths project intr (abccache, ps)
where
......@@ -894,7 +910,7 @@ remove_from_unknown_finished_processors completedSlot unknown_finished_processor
:: *DriverCodeGenerationInfo
= SyncCodeGeneration
// | ASyncCodeGeneration ![(Int,String,String)] !Int !UnknownFinishedProcessors // [(busy_process_number,abc_path,obj_path)] max_n_processes unknown_finished_processors
| ASyncCodeGeneration ![(Int,String,String)] !Int !UnknownFinishedProcessors // [(busy_process_number,abc_path,obj_path)] max_n_processes unknown_finished_processors
:: *DriverState
= DInit !Bool !Project !MTPContinuation
......@@ -916,19 +932,17 @@ remove_from_unknown_finished_processors completedSlot unknown_finished_processor
:: *DriverCompilingInfo
= Sync
/*
| AsyncWin !Int ![CurrentlyCompiled]
| Async ![CurrentlyCompiled] !Int !Int !UnknownFinishedProcessors // busy_processors max_n_processes n_used_processors unknown_finished_processors
*/
| Pers !*CompilingInfo
compiling_info :: !DriverCompilingInfo -> (String,DriverCompilingInfo)
/*
compiling_info info=:(AsyncWin _ current)
= (compiling_info_async current,info)
*/
compiling_info info=:(Async current _ _ _)
= (compiling_info_async current,info);
*/
compiling_info info
= ("",info)
......@@ -947,6 +961,7 @@ UpdateDependencies force next rest compinfo dircache ds ps`
# (cinf,compinfo) = compiling_info compinfo
# line = Level2 ((if verbose ("Analyzing \'" +++ modname +++ "\'. ") ("")) +++ cinf)
# ps = verboseInfo verbose line ps
# (proc,ps) = getCurrentProc ps
# ((abccache,fileinfo,info),ps)
= FI_GetFileInfo proc impname ds.abccache ds.fileinfo ps
# ds = {ds & abccache = abccache, fileinfo = fileinfo}
......@@ -956,7 +971,7 @@ UpdateDependencies force next rest compinfo dircache ds ps`
#! ps = showInfo lines ps
= case compinfo of
Sync -> UpdateSyncDependencies rest impname co dircache ds ps
// async=:(Async _ _ _ _)-> UpdateAsyncDependencies async rest impname co dircache ds ps
async=:(Async _ _ _ _)-> UpdateAsyncDependencies async rest impname co dircache ds ps
// async=:(AsyncWin _ _)-> UpdateAsyncDependencies async rest impname co dircache ds ps
(Pers info) -> UpdatePersDependencies info rest impname co dircache ds ps
| info.sys // system module
......@@ -1022,7 +1037,7 @@ UpdateDependencies force next rest compinfo dircache ds ps`
#! ps = showInfo lines ps
= case compinfo of
Sync -> UpdateSyncDependencies rest impname co dircache ds ps
// async=:(Async _ _ _ _)-> UpdateAsyncDependencies async rest impname co dircache ds ps
async=:(Async _ _ _ _ )-> UpdateAsyncDependencies async rest impname co dircache ds ps
// async=:(AsyncWin _ _)-> UpdateAsyncDependencies async rest impname co dircache ds ps
(Pers info) -> UpdatePersDependencies info rest impname co dircache ds ps
# ((ok,mods,xxx_md,xxx_dd,objs,libs,abccache),ps)
......@@ -1050,14 +1065,13 @@ UpdateDependencies force next rest compinfo dircache ds ps`
#! ps = showInfo lines ps
= case compinfo of
Sync -> UpdateSyncDependencies rest impname co dircache ds ps
// async=:(Async _ _ _ _ )-> UpdateAsyncDependencies async rest impname co dircache ds ps
async=:(Async _ _ _ _ )-> UpdateAsyncDependencies async rest impname co dircache ds ps
// async=:(AsyncWin _ _ )-> UpdateAsyncDependencies async rest impname co dircache ds ps
(Pers info) -> UpdatePersDependencies info rest impname co dircache ds ps
where
(prefs,ps) = getPrefs ps` // lift to DriverState
project = ds.project
proc = PR_GetProcessor project
ao = PR_GetApplicationOptions project
mp = ao.memoryProfiling
tp = ao.profiling
......@@ -1099,7 +1113,7 @@ where
get_free_slot :: [CurrentlyCompiled] -> Int
get_free_slot current
= hd (removeMembers [0..] [slot \\ {slot} <- current])
*/
UpdateAsyncDependencies (Async current cmax n_used_processors unknown_finished_processors) rest impname co dircache ds ps
# free_slot = get_free_slot current
# (compileStarted, fileinfo, dircache, abccache, ps)
......@@ -1121,7 +1135,7 @@ where
get_free_slot :: [CurrentlyCompiled] -> Int
get_free_slot current
= hd (removeMembers [0..] [slot \\ {slot} <- current])
*/
UpdateSyncDependencies rest impname co dircache ds ps
# (ps,fileinfo,dircache,abccache,project,ok,newpaths,_,deps)
= CompileTheProjectModule True Compilation impname ds.fileinfo dircache ds.abccache ds.project ps
......@@ -1140,7 +1154,8 @@ CompileTheProjectModule :: !Bool !CompileOrCheckSyntax !Pathname !FileInfoCache
-> *(*PSt *General,FileInfoCache,*DirCache,*ABCCache,Project,Bool,Bool,Pathname,List Pathname)
CompileTheProjectModule outofdate compileOrCheckSyntax path fileinfo dircache abccache project ps
| not outofdate
# proc = PR_GetProcessor project
// # proc = PR_GetProcessor project
# (proc,ps) = getCurrentProc ps
# ((abccache,fileinfo,info), ps)
= FI_GetFileInfo proc path abccache fileinfo ps // so that its added to FileInfo cache...
= (ps,fileinfo,dircache,abccache,project,True,False,info.abcpath,Nil)
......@@ -1382,14 +1397,15 @@ where
// Generate code for the designated module.
GenCodeTheProjectModule :: !.Bool !.Bool !.CodeGenerateAsmOrCode !.Pathname !*ABCCache !FileInfoCache !Project !*(PSt General) -> *(*PSt General,*ABCCache,FileInfoCache,Project,Bool,Pathname)
GenCodeTheProjectModule outofdate sys genAsmOrCode abc_path abccache fileinfo project ps`
# ((abccache,fileinfo,info), ps) = FI_GetFileInfo cgo.tp abc_path abccache fileinfo ps
# (proc,ps) = getCurrentProc ps
# ((abccache,fileinfo,info), ps) = FI_GetFileInfo proc abc_path abccache fileinfo ps
| not outofdate
= (ps,abccache,fileinfo,project,True,info.objpath)
# ps = showInfo (Level2 ("Generating code for '" +++ RemovePath abc_path +++ "'.")) ps
# (startupdir,ps) = getStup ps
# (cgen,ps) = getCurrentCgen ps
# (ps, objpath,res) = CodeGen cgen updateErrorWindow genAsmOrCode abc_path tp cgo ao startupdir ps
# (ps, objpath,res) = CodeGen cgen updateErrorWindow genAsmOrCode abc_path timeprofile cgo proc ao startupdir ps
| genAsmOrCode == CodeGeneration && res
# (fileinfo,ps) = accFiles (FI_UpdateObjDate abc_path objpath fileinfo) ps
# project = if sys
......@@ -1402,7 +1418,7 @@ where
ao = PR_GetApplicationOptions project
mn = GetModuleName abc_path
tp = ao.profiling && (not co.neverTimeProfile)
timeprofile = ao.profiling && (not co.neverTimeProfile)
modname = mn
modinfo = PR_GetModuleInfo modname project
co = case modinfo of
......@@ -1414,7 +1430,8 @@ where
// Checks whether .o files in the project are out of date.
CheckABCOutOfDate :: !.Bool !.Pathname !*ABCCache !FileInfoCache !Project !*(PSt General) -> *(*(PSt General),*ABCCache,FileInfoCache,Bool,Pathname)
CheckABCOutOfDate sys path abccache fileinfo project ps
# tp = PR_GetProcessor project
// # tp = PR_GetProcessor project
# (tp,ps) = getCurrentProc ps
# ((abccache,fileinfo,modinfo), ps)
= FI_GetFileInfo tp path abccache fileinfo ps
# abcexists = modinfo.abcdate.exists
......@@ -1428,32 +1445,32 @@ CheckABCOutOfDate sys path abccache fileinfo project ps
# gencode = cg_opt || abc
# ({be_verbose},ps) = getPrefs ps
# lines = if be_verbose
(Level3 (MakeABCOutOfDateMessage mn abc abcexists objexists cg_opt))
(Level3 (MakeABCOutOfDateMessage tp mn abc abcexists objexists cg_opt))
(Level3 [])
# ps = verboseInfo be_verbose lines ps
= (ps, abccache,fileinfo, gencode, modinfo.abcpath)
where
MakeABCOutOfDateMessage :: !Modulename !Bool !Bool !Bool !Bool -> [String]
MakeABCOutOfDateMessage mn abc abcexists objexists cgo
MakeABCOutOfDateMessage :: !Processor !Modulename !Bool !Bool !Bool !Bool -> [String]
MakeABCOutOfDateMessage tp mn abc abcexists objexists cgo
| abcexists
| abc || not objexists
| cgo
| objexists
= ["[" +++ mn +++ ".obj,]: is older than .abc file, new paths or new code generator options set"]
= ["[" +++ mn +++ ".obj,]: does not exist, new paths or new code generator options set"]
= ["[" +++ MakeObjPathname tp mn +++ ",]: is older than .abc file, new paths or new code generator options set"]
= ["[" +++ MakeObjPathname tp mn +++ ",]: does not exist, new paths or new code generator options set"]
| objexists
= ["[" +++ mn +++ ".obj,]: is older than .abc file"]
= ["[" +++ mn +++ ".obj,]: does not exist"]
= ["[" +++ MakeObjPathname tp mn +++ ",]: is older than .abc file"]
= ["[" +++ MakeObjPathname tp mn +++ ",]: does not exist"]
| cgo
= ["[" +++ mn +++ ".obj,]: new paths or new code generator options set"]
= ["[" +++ MakeObjPathname tp mn +++ ",]: new paths or new code generator options set"]
= []
= []
//-- Link Phase...
MakeOptionsName :: !.String -> String
MakeOptionsName path
= path`+++{dirseparator}+++"Clean System Files"+++{dirseparator}+++"_"+++name+++"_options.o"
MakeOptionsName :: !.String !Processor -> String
MakeOptionsName path processor
= path`+++{dirseparator}+++"Clean System Files"+++{dirseparator}+++"_"+++name+++MakeObjPathname processor "_options"
where
path` = RemoveFilename path
name = RemoveSuffix` (RemovePath path)
......@@ -1475,7 +1492,7 @@ CheckObjsOutOfDate gen execpath objs ps
# (ood,ps) = accFiles (check date objs) ps
| ood
# lines = if be_verbose
(Level3 ["[" +++ execname +++ ",]: is older than .obj files. Linking new executable."])
(Level3 ["[" +++ execname +++ ",]: is older than object files. Linking new executable."])
(Level3 [])
= (True, verboseInfo be_verbose lines ps)
= (False,ps)
......@@ -1503,7 +1520,7 @@ CheckExecOutOfDate gen execpath fileinfo project ps
| link
# lines = if be_verbose
(if date.exists
(Level3 ["[" +++ execname +++ ",]: is older than .obj files. Linking new executable."])
(Level3 ["[" +++ execname +++ ",]: is older than object files. Linking new executable."])