Commit a515a6f0 authored by John van Groningen's avatar John van Groningen

add "Dynamics" and "Generate descriptors and export labels" project options

parent 4ef8db39
......@@ -9,7 +9,7 @@ from PmCleanSystem import ::CompilerProcessIds,NoCompilerProcessIds
from StdPStClass import instance FileEnv (PSt .l)
//-- batch build support
from StdProcess import closeProcess
from StdPStClass import class FileSystem, instance FileSystem PSt
from StdPStClass import class FileSystem, instance FileSystem (PSt .l)
import logfile, PlatformObjectIO
:: InfoDialogInfo =
......
......@@ -278,16 +278,10 @@ where
, ("No Time Profiling",Nothing,noPS (\l->{l & ao = {l.ao & profiling = False, stack_traces = False}}))
]
(Columns 1)
(if ao.profiling
(if ao.stack_traces
2
1
)
3
)
(if ao.profiling (if ao.stack_traces 2 1) 3)
[ControlPos (Left,zero)]
:+: CheckControl
[("Heap Profile",Nothing,toMark ao.memoryProfiling, noPS (\l->{l & ao = {l.ao & memoryProfiling = not l.ao.memoryProfiling}}))]
[("Heap Profile",Nothing,toMark ao.memoryProfiling, noPS (\l->{l & ao.memoryProfiling = not l.ao.memoryProfiling}))]
(Columns 1) [ControlPos (Left,zero)]
:+: EditControl (IntToMemSize ao.memoryProfilingMinimumHeapSize) (PixelWidth 100) 1
[ ControlPos (Left,zero)
......@@ -295,6 +289,14 @@ where
, ControlActivate (noLS (appPIO (setEditControlSelection mhId 1 0)))
]
:+: TextControl "Minimum Profile Heap" []
:+: TextControl "Language Options" [ControlPos (Left,OffsetVector {vx=0,vy=10})]
:+: CheckControl
[("Dynamics",Nothing,toMark ao.dynamics,noPS (\l->{l & ao.dynamics = not l.ao.dynamics}))]
(Columns 1) [ControlPos (Left,zero)]
:+: TextControl "Code Generation Options" [ControlPos (Left,OffsetVector {vx=0,vy=10})]
:+: CheckControl
[("Generate descriptors and export labels",Nothing,toMark ao.desc_exl,noPS (\l->{l & ao.desc_exl = not l.ao.desc_exl}))]
(Columns 1) [ControlPos (Left,zero)]
)
diagnosticsPane = Pane "Diagnostics"
( TextControl "Diagnostics Options" []
......@@ -307,9 +309,8 @@ where
, ("Check Indices" ,Nothing, toMark cgo.ci, noPS (\l->{l & cgo = {l.cgo & ci = not l.cgo.ci}}))
]
(Columns 1)
[ ControlPos (Left,zero)
]
:+: TextControl "Stack Tracing can be set in the profiling panel." [ControlPos (Left,zero)]
[ControlPos (Left,zero)]
:+: TextControl "Stack tracing can be set in the profiling panel." [ControlPos (Left,zero)]
)
linkerPane = Pane "Linker"
( TextControl "Linker Options" []
......
......@@ -9,18 +9,19 @@ from PmDirCache import :: DirCache
// Compiler options that are stored in the abc file
:: ABCOptions =
{ abcMemoryProfile :: !Bool // -desc
{ abcDescriptors :: !Bool
, abcTimeProfile :: !Bool
, abcStrictnessAnalysis :: !Bool
, abcGiveWarnings :: !Bool //.
, abcBeVerbose :: !Bool //--> now abused for -exl flag
, abcExportLocalLabels :: !Bool
, abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
, abc64Bits :: !Bool
, abcDynamics :: !Bool
}
DefaultABCOptions :: ABCOptions
DefaultABCOptions :: ABCOptions
:: *ABCCache
:: ModuleDate :== DateTime
......
......@@ -20,28 +20,30 @@ from StdLibMisc import :: Date{..}, :: Time{..}
//-- ABCOptions: Compiler options that are stored in the abc file
:: ABCOptions =
{ abcMemoryProfile :: !Bool
{ abcDescriptors :: !Bool
, abcTimeProfile :: !Bool
, abcStrictnessAnalysis :: !Bool
, abcGiveWarnings :: !Bool
, abcBeVerbose :: !Bool
, abcExportLocalLabels :: !Bool
, abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
, abc64Bits :: !Bool
, abcDynamics :: !Bool
}
DefaultABCOptions :: ABCOptions;
DefaultABCOptions =
{ abcMemoryProfile = False
{ abcDescriptors = False
, abcTimeProfile = False
, abcStrictnessAnalysis = True
, abcGiveWarnings = False
, abcBeVerbose = False
, abcExportLocalLabels = False
, abcGenerateComments = False
, abcReuseUniqueNodes = False
, abcFusion = False
, abc64Bits = False
, abcDynamics = False
}
//-- abc file handling
......@@ -58,17 +60,18 @@ DefaultABCOptions =
DebugMask :== 0;
DontReuseUniqueNodesMask :== 1;
ParallelMask :== 2;
NoMemoryProfileMask :== 3;
NoDescriptorsBitOffset :== 3;
StrictnessMask :== 4;
NoTimeProfileMask :== 5;
VerboseMask :== 6;
ExportLocalLabelsBitsOffset :== 6;
WarningsMask :== 7;
SystemMask :== 8;
FusionOffset :== 9;
Abc64BitsOffset :==10;
DynamicsBitsOffset :==11;
MinimumNrOfOptions :== 9;
NrOfOptions :== 11;
NrOfOptions :== 12;
ParseABCInfoAndDependencies :: !Pathname !DATE !ABCCache !Files -> (!((!Bool, !Bool, !Int, !ABCOptions),(!List Modulename, !Maybe ModuleDate, !List ModuleDate, !List LinkObjFileName, !List LinkLibraryName),!ABCCache),!Files)
ParseABCInfoAndDependencies path date abccache files
......@@ -149,15 +152,16 @@ where
StringToCompilerOptions :: !Int !Int !String -> ABCOptions;
StringToCompilerOptions start end opt
= { abcMemoryProfile = not (opt.[start+NoMemoryProfileMask] == '1'),
= { abcDescriptors = not (opt.[start+NoDescriptorsBitOffset] == '1'),
abcTimeProfile = not (opt.[start+NoTimeProfileMask] == '1'),
abcStrictnessAnalysis = opt .[start+StrictnessMask] == '1',
abcGiveWarnings = opt .[start+WarningsMask] == '1',
abcBeVerbose = opt .[start+VerboseMask] == '1',
abcExportLocalLabels = opt .[start+ExportLocalLabelsBitsOffset] == '1',
abcGenerateComments = opt .[start+DebugMask] == '1',
abcReuseUniqueNodes = not (opt.[start+DontReuseUniqueNodesMask] == '1'),
abcFusion = start+FusionOffset<end && opt.[start+FusionOffset]=='1',
abc64Bits = start+Abc64BitsOffset<end && opt.[start+Abc64BitsOffset]=='1'
abc64Bits = start+Abc64BitsOffset<end && opt.[start+Abc64BitsOffset]=='1',
abcDynamics = start+DynamicsBitsOffset<end && opt.[start+DynamicsBitsOffset]=='1'
};
ProjectABCFile :: !Int !String -> Bool;
......
......@@ -1115,7 +1115,13 @@ UpdateDependencies force mdn rest compinfo dircache ds ps`
= (ps,dircache,False,False,rest,compinfo,ds,False)
# ((okA,whyA,dircache),ps) = accFiles (AccTuple4 (check_dependant_dates module_name mods xxx_md xxx_dd dircache)) ps
# (use_64_bit_processor,ps) = getCurrent64BitProcessor ps
# (okC,whyC) = check_module_options module_name info co mp tp eod use_64_bit_processor version
# project_compiler_options = { pco_memory_profiling=ao.memoryProfiling,
pco_time_profiling=ao.profiling,
pco_desc_exl=ao.desc_exl,
pco_dynamics=ao.dynamics,
pco_link_dynamic=link_dynamic}
# (okC,whyC) = check_module_options module_name info co project_compiler_options use_64_bit_processor version
| okA && okC
# ((ok,paths,dircache),ps) = accFiles (AccTuple4 (LookupModulePaths mods dircache)) ps
......@@ -1139,9 +1145,7 @@ where
mp = ao.memoryProfiling
tp = ao.profiling
lo = PR_GetLinkOptions project
eod = case lo.method of
LM_Static -> False
LM_Dynamic -> True
link_dynamic = case lo.method of LM_Static -> False; LM_Dynamic -> True
verbose = prefs.be_verbose
defaultCO = prefs.compopts
......@@ -1209,13 +1213,13 @@ UpdatePersDependencies mdn cstate rest co dircache ds ps
CompileTheProjectModule :: !CompileOrCheckSyntax !ModuleDirAndName !Pathname !FileInfoCache !*ABCCache !Project !*DirCache !*GeneralSt
-> *(FileInfoCache,*ABCCache,Project,Bool,Bool,Pathname,[!ModuleDirAndName],*DirCache,*GeneralSt)
CompileTheProjectModule compileOrCheckSyntax mdn hierarchical_imp_pathname fileinfo abccache project dircache ps
# (ok,ccstring,write_module_times,errwin,typwin,srcpaths,mp,tp,eod,co,startupdir,ps)
# (ok,ccstring,write_module_times,errwin,typwin,srcpaths,project_compiler_options,co,startupdir,ps)
= ShowInfoAndCompile compileOrCheckSyntax mdn.mdn_name project ps
| not ok
= (fileinfo,abccache,project,False,False,"",[!],dircache,ps)
# (use_compiler_process_ids,compiler_process_ids,ps) = get_use_compiler_process_ids_and_compiler_process_ids ps
# (abcpath,res,compiler_process_ids,ps)
= Compile ccstring use_compiler_process_ids write_module_times errwin typwin compileOrCheckSyntax mdn hierarchical_imp_pathname srcpaths mp tp eod co startupdir compiler_process_ids ps
= Compile ccstring use_compiler_process_ids write_module_times errwin typwin compileOrCheckSyntax mdn hierarchical_imp_pathname srcpaths project_compiler_options co startupdir compiler_process_ids ps
# ps = setCompilerProcessIds compiler_process_ids ps
# (_,res) = ProcessCompilerMsg Nothing compileOrCheckSyntax co mdn abcpath res fileinfo dircache abccache project ps
= res
......@@ -1230,63 +1234,59 @@ get_use_compiler_process_ids_and_compiler_process_ids ps
CompileTheProjectModuleStart :: !CompileOrCheckSyntax !ModuleDirAndName !Int !FileInfoCache !*DirCache !*ABCCache !Project !CompilerProcessIds !*GeneralSt
-> *(!Bool, FileInfoCache, *DirCache, *ABCCache, CompilerProcessIds, *GeneralSt)
CompileTheProjectModuleStart compileOrCheckSyntax mdn slot fileinfo dircache abccache project compiler_process_ids ps
# (ok,ccstring,write_module_times,errwin,_,srcpaths,mp,tp,eod,co,startupdir,ps)
# (ok,ccstring,write_module_times,errwin,_,srcpaths,project_compiler_options,co,startupdir,ps)
= CTPMcommon mdn.mdn_name project ps
| not ok
= (False, fileinfo, dircache, abccache,compiler_process_ids,ps)
# (compileStarted,compiler_process_ids,ps)
= CompileStartCommand ccstring write_module_times errwin compileOrCheckSyntax mdn.mdn_name srcpaths slot mp tp eod co startupdir compiler_process_ids ps
= CompileStartCommand ccstring write_module_times errwin compileOrCheckSyntax mdn.mdn_name srcpaths slot project_compiler_options co startupdir compiler_process_ids ps
= (compileStarted, fileinfo, dircache, abccache,compiler_process_ids,ps)
PersistentCompile :: !*CompilingInfo !CompileOrCheckSyntax !ModuleDirAndName !FileInfoCache !*DirCache !*ABCCache !Project !*GeneralSt
-> (*CompilingInfo,*(FileInfoCache,*ABCCache,Project,Bool,Bool,Pathname,[!ModuleDirAndName],*DirCache,*GeneralSt))
PersistentCompile cstate compileOrCheckSyntax mdn fileinfo dircache abccache project ps
# (ok,ccstring,write_module_times,errwin,typwin,srcpaths,mp,tp,eod,co,startupdir,ps)
# (ok,ccstring,write_module_times,errwin,typwin,srcpaths,project_compiler_options,co,startupdir,ps)
= ShowInfoAndCompile compileOrCheckSyntax mdn.mdn_name project ps
| not ok
= (cstate,(fileinfo,abccache,project,False,False,"",[!],dircache,ps))
# (cstate,(ps,abcpath,res)) = CompilePersistent ccstring write_module_times errwin typwin compileOrCheckSyntax mdn srcpaths mp tp eod co startupdir cstate ps
# (cstate,(ps,abcpath,res)) = CompilePersistent ccstring write_module_times errwin typwin compileOrCheckSyntax mdn srcpaths project_compiler_options co startupdir cstate ps
# (Just cstate,rest)
= ProcessCompilerMsg (Just cstate) compileOrCheckSyntax co mdn abcpath res fileinfo dircache abccache project ps
= (cstate,rest)
ShowInfoAndCompile :: !CompileOrCheckSyntax !Pathname !Project !*GeneralSt
-> *(Bool, String, Bool, ([String] *GeneralSt -> *GeneralSt), ([String] *GeneralSt -> *GeneralSt), List String, Bool, Bool, Bool, CompilerOptions, String, *GeneralSt)
-> *(Bool, String, Bool, ([String] *GeneralSt -> *GeneralSt), ([String] *GeneralSt -> *GeneralSt), List String, ProjectCompilerOptions, CompilerOptions, String, *GeneralSt)
ShowInfoAndCompile compileOrCheckSyntax module_name project ps
# line = Level2 ((if (compileOrCheckSyntax == Compilation) "Compiling '" "Checking '") +++ module_name +++ "'.")
# ps = showInfo line ps
= CTPMcommon module_name project ps
CTPMcommon :: !Modulename !Project !*GeneralSt
-> *(Bool, String, Bool, ([String] *GeneralSt -> *GeneralSt), ([String] *GeneralSt -> *GeneralSt), List String, Bool, Bool, Bool, CompilerOptions, String, *GeneralSt)
CTPMcommon mn project ps0
-> *(Bool, String, Bool, ([String] *GeneralSt -> *GeneralSt), ([String] *GeneralSt -> *GeneralSt), List String, ProjectCompilerOptions, CompilerOptions, String, *GeneralSt)
CTPMcommon module_name project ps
# (syspaths,ps) = getCurrentPaths ps
# (startupdir,ps) = getStup ps
# ({compopts},ps) = getPrefs ps
# defaultCO = compopts
# modinfo = PR_GetModuleInfo mn project
# modinfo = PR_GetModuleInfo module_name project
# co = if (isJust modinfo) ((fromJust modinfo).compilerOptions) defaultCO
# (ccstring,ps) = getCurrentComp ps
# write_module_times = True//version == 918
# (ccstring,ps) = getCurrentComp ps
# write_module_times = True
# prjpaths = PR_GetPaths project
#! srcpaths = Concat prjpaths syspaths
= (True,ccstring,write_module_times,updateErrorWindow,typewin mn,srcpaths,mp,tp,eod,co,startupdir,ps)
# ao = PR_GetApplicationOptions project
# link_dynamic = case (PR_GetLinkOptions project).method of LM_Static -> False; LM_Dynamic -> True
# project_compiler_options = { pco_memory_profiling=ao.memoryProfiling,
pco_time_profiling=ao.profiling,
pco_desc_exl=ao.desc_exl,
pco_dynamics=ao.dynamics,
pco_link_dynamic=link_dynamic}
= (True,ccstring,write_module_times,updateErrorWindow,typewin module_name,srcpaths,project_compiler_options,co,startupdir,ps)
where
(syspaths,ps1) = getCurrentPaths ps0
(version,ps) = getCurrentVers ps1
ao = PR_GetApplicationOptions project
prjpaths = PR_GetPaths project
typewin :: !String ![String] !*GeneralSt -> *GeneralSt
typewin mn strings ps
typewin module_name strings ps
# (interact, ps) = getInteract ps
= update_type_window interact mn strings ps
mp = ao.memoryProfiling
tp = ao.profiling
lo = PR_GetLinkOptions project
eod = case lo.method of
LM_Static -> False
LM_Dynamic -> True
= update_type_window interact module_name strings ps
ProcessCompilerMsg :: !*(Maybe *CompilingInfo) !CompileOrCheckSyntax !CompilerOptions !ModuleDirAndName !Pathname !CompilerMsg !FileInfoCache !*DirCache !ABCCache !Project !*GeneralSt
-> *(*(Maybe *CompilingInfo),(FileInfoCache,*ABCCache,Project,Bool,Bool,Pathname,[!ModuleDirAndName],*DirCache,*GeneralSt))
......@@ -1414,19 +1414,19 @@ where
= (ok,".lhs",yyy_md,dircache,files)
= (ok,".icl",yyy_md,dircache,files)
check_module_options :: !String !.FileInfo !.CompilerOptions !.Bool !.Bool !.Bool !Bool !.Int -> (.Bool,{#Char});
check_module_options modname info=:{version,abcOptions} co mp tp expectedEagerOrDynamic use_64_bit_processor expectedVersion
check_module_options :: !String !FileInfo !CompilerOptions !ProjectCompilerOptions !Bool !Int -> (!Bool,{#Char});
check_module_options modname info=:{version,abcOptions} co project_compiler_options use_64_bit_processor expectedVersion
| version <> expectedVersion
= (False,"["+++modname+++".icl,]: .abc out of date, different abc version.")
| abcOptions.abc64Bits<>use_64_bit_processor
= incorrect_option modname "32 or 64 bit code"
| abcOptions.abcBeVerbose <> expectedBeVerbose
= incorrect_option modname "Dynamics"
| abcOptions.abcExportLocalLabels <> expectedExportLocalLabels
= incorrect_option modname "Export local labels or link dynamic"
| abcOptions.abcTimeProfile <> expectedTimeProfile
= incorrect_option modname "Time Profiling"
| abcOptions.abcMemoryProfile <> expectedMemoryProfile // <- is this how we use it now?
= incorrect_option modname "Heap Profiling"
| abcOptions.abcDescriptors <> expectedDescriptors
= incorrect_option modname "Generate descriptors or heap profiling"
| abcOptions.abcStrictnessAnalysis <> expectedStrictnessAnalysis
= incorrect_option modname "Strictness Analysis"
// || abcOptions.abcGenerateComments <> expectedGenerateComments // <- do we need to regenerate for this?
......@@ -1436,12 +1436,14 @@ check_module_options modname info=:{version,abcOptions} co mp tp expectedEagerOr
= incorrect_option modname "Reuse Unique Nodes"
| abcOptions.abcFusion<>co.fusion
= incorrect_option modname "Fusion"
| abcOptions.abcDynamics <> project_compiler_options.pco_dynamics
= incorrect_option modname "Dynamics"
= (True,"")
where
expectedMemoryProfile = expectedEagerOrDynamic || (mp && (not co.neverMemoryProfile))
expectedTimeProfile = tp && (not co.neverTimeProfile)
expectedDescriptors = project_compiler_options.pco_desc_exl || project_compiler_options.pco_link_dynamic || (project_compiler_options.pco_memory_profiling && (not co.neverMemoryProfile))
expectedTimeProfile = project_compiler_options.pco_time_profiling && (not co.neverTimeProfile)
expectedStrictnessAnalysis = co.sa
expectedBeVerbose = expectedEagerOrDynamic
expectedExportLocalLabels = project_compiler_options.pco_desc_exl || project_compiler_options.pco_link_dynamic
expectedGenerateComments = co.gc
expectedReuseUniqueNodes = co.reuseUniqueNodes
......
......@@ -242,13 +242,15 @@ where
fromString s
= toInt s
ApplicationProfiletOptionsTable :: OptionsTable ApplicationOptions
ApplicationProfiletOptionsTable =
ApplicationProfileOptionsTable :: OptionsTable ApplicationOptions
ApplicationProfileOptionsTable =
{
SimpleOption "Memory" (\a->a.memoryProfiling) (\v a->{a & memoryProfiling=v}),
SimpleOption "MemoryMinimumHeapSize" (\a->a.memoryProfilingMinimumHeapSize) (\v a->{a & memoryProfilingMinimumHeapSize=v}),
SimpleOption "Time" (\a->a.profiling) (\v a->{a & profiling=v}),
SimpleOption "Stack" (\a->a.stack_traces) (\v a->{a & stack_traces=v})
SimpleOption "Stack" (\a->a.stack_traces) (\v a->{a & stack_traces=v}),
SimpleOption "Dynamics" (\a->a.dynamics) (\v a->{a & dynamics=v}),
SimpleOption "DescExL" (\a->a.desc_exl) (\v a->{a & desc_exl=v})
}
ApplicationOutputOptionsTable :: OptionsTable ApplicationOptions
......@@ -274,7 +276,7 @@ ApplicationOptionsTable =
SimpleOption "MarkingCollector" (\a->a.marking_collection) (\v a->{a & marking_collection=v}),
SimpleOption "DisableRTSFlags" (\a->a.disable_rts_flags) (\v a->{a & disable_rts_flags=v}),
SimpleOption "StandardRuntimeEnv" (\a->a.standard_rte) (\v a->{a & standard_rte=v}),
GroupedOption "Profile" ApplicationProfiletOptionsTable id const,
GroupedOption "Profile" ApplicationProfileOptionsTable id const,
GroupedOption "Output" ApplicationOutputOptionsTable id const
}
......
......@@ -297,6 +297,8 @@ eqAppOpts ao1 ao2
ao1.memoryProfilingMinimumHeapSize == ao2.memoryProfilingMinimumHeapSize &&
ao1.profiling == ao2.profiling &&
ao1.stack_traces == ao2.stack_traces &&
ao1.dynamics == ao2.dynamics &&
ao1.desc_exl == ao2.desc_exl &&
ao1.standard_rte == ao2.standard_rte
// do we need to check resource linking flags???
......@@ -582,7 +584,6 @@ SetProject applicationDir project_file_dir
, pg_root_directory, pg_precompile, pg_postlink
}
# project_dir = make_project_dir (size pg_root_directory) project_file_dir
# paths = ExpandPaths applicationDir project_dir pg_projectPaths
# linkOptions = ExpandLinkOptionsPaths applicationDir project_dir pg_link
# project = PR_AddRootModule pg_codegen pg_application paths linkOptions name (ExpandModuleInfoPaths applicationDir project_dir info)
......
......@@ -128,6 +128,8 @@ DefCodeGenOptions :: CodeGenOptions
, memoryProfilingMinimumHeapSize :: !Int
, profiling :: !Bool // time profiling
, stack_traces :: !Bool // stack traces
, dynamics :: !Bool
, desc_exl :: !Bool
, standard_rte :: !Bool // DvA: use standard RTE (only in IDE)
}
......
......@@ -309,7 +309,7 @@ DefCodeGenOptions =
, sgc :: !Bool
, pss :: !Bool
, marking_collection :: !Bool
, disable_rts_flags :: !Bool
, disable_rts_flags :: !Bool
, o :: !Output
, fn :: !String // !FontName
, fs :: !Int // !FontSize
......@@ -318,6 +318,8 @@ DefCodeGenOptions =
, memoryProfilingMinimumHeapSize :: !Int
, profiling :: !Bool
, stack_traces :: !Bool
, dynamics :: !Bool
, desc_exl :: !Bool
, standard_rte :: !Bool // DvA: use standard RTE (only in IDE)
}
......@@ -342,6 +344,8 @@ DefApplicationOptions =
, memoryProfilingMinimumHeapSize = 0
, profiling = False
, stack_traces = False
, dynamics = False
, desc_exl = False
, standard_rte = True
}
......
......@@ -39,6 +39,14 @@ instance == CompilerMsg
:: WindowFun env :== ([String]) -> env -> env
:: ProjectCompilerOptions = {
pco_memory_profiling :: !Bool,
pco_time_profiling :: !Bool,
pco_desc_exl :: !Bool,
pco_dynamics :: !Bool,
pco_link_dynamic :: !Bool
}
Compile :: // Compiles the given file:
!String // compiler exe name and options
// !! should be full path so that cocl generates diagnostics in logical place...
......@@ -51,9 +59,7 @@ Compile :: // Compiles the given file:
!ModuleDirAndName
!Pathname // full .icl pathname of module to be compiled
!(List Pathname) // list of paths where compiler can find imported .dcl files
!Bool // project memory profiling?
!Bool // project time profiling?
!Bool // project eager or dynamic linking?
!ProjectCompilerOptions
!CompilerOptions // compiler options
!Pathname // startup directory
!CompilerProcessIds
......@@ -147,9 +153,7 @@ CompileStartCommand ::
!Pathname
!(List Pathname)
!Int
!Bool
!Bool
!Bool
!ProjectCompilerOptions
!CompilerOptions
!Pathname
!CompilerProcessIds
......@@ -176,9 +180,7 @@ CompilePersistent ::
!CompileOrCheckSyntax // compileOrCheckSyntax
!ModuleDirAndName
!(List Pathname) // paths
!Bool // projectHeapProfiling
!Bool // projectTimeProfiling
!Bool // projectEagerOrDynamic
!ProjectCompilerOptions
!CompilerOptions // compileroptions
!Pathname // startupdir
!*CompilingInfo // compiler state
......
......@@ -161,24 +161,30 @@ where
//-- Synchronous compilation stuff...
:: ProjectCompilerOptions = {
pco_memory_profiling :: !Bool,
pco_time_profiling :: !Bool,
pco_desc_exl :: !Bool,
pco_dynamics :: !Bool,
pco_link_dynamic :: !Bool
}
Compile ::
!String !Bool !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName !Pathname
!(List Pathname) !Bool !Bool !Bool !CompilerOptions !Pathname !CompilerProcessIds !*env
!(List Pathname) !ProjectCompilerOptions !CompilerOptions !Pathname !CompilerProcessIds !*env
-> (!Pathname,!CompilerMsg,!CompilerProcessIds,!*env)
| FileEnv env
Compile
cocl` use_compiler_process_ids write_module_times errwin typewin compileOrCheckSyntax mdn path paths projectMemoryProfiling
projectTimeProfiling projectEagerOrDynamic co=:{CompilerOptions | listTypes}
startupdir compiler_process_ids ps
cocl` use_compiler_process_ids write_module_times errwin typewin compileOrCheckSyntax mdn path paths project_compiler_options
co=:{CompilerOptions | listTypes} startupdir compiler_process_ids ps
# (cocl_ok,cocl,cocldir) = mangleCompiler cocl` startupdir // platform dependant mangling...
| not cocl_ok
# ps = errwin [cocl] ps
= ("",SyntaxError,compiler_process_ids,ps)
# out_file_name = out_file_path tooltempdir dummy_slot
errors_file_name = errors_file_path tooltempdir dummy_slot
# command = cocl +++ write_module_times_string +++ CompileBuildCommand
out_file_name errors_file_name compileOrCheckSyntax path paths
projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic co
# command = cocl +++ write_module_times_string +++
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths project_compiler_options co
(didit, exitcode, os4) = call_process command cocldir 99
diditall = if (os4 == 99) didit didit
| not diditall
......@@ -219,34 +225,10 @@ mangleCompiler2 ccstring` startupdir
:: ExitCode
:== Int
/*
CompileStartCommand :: !String !Bool !(WindowFun *env) !CompileOrCheckSyntax !Pathname !(List Pathname) !Int !Bool !Bool !Bool
!CompilerOptions !Pathname !CompilerProcessIds !*env -> (!Bool,!CompilerProcessIds,!*env) | FileEnv env
CompileStartCommand cocl` write_module_times errwin compileOrCheckSyntax path paths slot projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic
co startupdir compiler_process_ids ps
# (cocl_ok,cocl,cocldir) = mangleCompiler cocl` startupdir // platform dependant mangling...
| not cocl_ok
# ps = errwin [cocl] ps
= (False,compiler_process_ids,ps)
# out_file_name = out_file_path tooltempdir slot
errors_file_name = errors_file_path tooltempdir slot
# command
= cocl +++ " " +++ CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths
projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic co
(didit, os4) = AsyncCallProcess (command +++ "\0") slot 99
diditall = if (os4 == 99) didit didit
| not diditall
= (False,compiler_process_ids,errwin ["Error: Unable to run compiler: "+++cocl] ps)
// otherwise
= (True,compiler_process_ids,ps)
where
write_module_times_string = if write_module_times " -wmt " " "
*/
CompileStartCommand :: !String !Bool !(WindowFun *env) !CompileOrCheckSyntax !Pathname !(List Pathname) !Int !Bool !Bool !Bool
CompileStartCommand :: !String !Bool !(WindowFun *env) !CompileOrCheckSyntax !Pathname !(List Pathname) !Int !ProjectCompilerOptions
!CompilerOptions !Pathname !CompilerProcessIds !*env
-> (!Bool,!CompilerProcessIds,!*env) | FileEnv env
CompileStartCommand cocl` write_module_times errwin compileOrCheckSyntax path paths slot projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic
CompileStartCommand cocl` write_module_times errwin compileOrCheckSyntax path paths slot project_compiler_options
co startupdir compiler_process_ids ps
# (cocl_ok,cocl,cocl_dir,cocl_startup,options) = mangleCompiler2 cocl` startupdir // platform dependant mangling...
| not cocl_ok
......@@ -256,7 +238,7 @@ CompileStartCommand cocl` write_module_times errwin compileOrCheckSyntax path pa
# errors_file_name = errors_file_path tooltempdir slot
# cocl_arguments
= " -id " +++toString slot+++" "+++options +++ write_module_times_string +++.
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic co
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths project_compiler_options co
# (compile_ok,compiler_process_ids,ps) = start_compile_with_cache cocl slot cocl_dir cocl_startup cocl_arguments compiler_process_ids ps;
| not compile_ok
# ps = errwin ["Error: Unable to run compiler: "+++cocl] ps
......@@ -288,17 +270,6 @@ start_compile_with_cache2 path {compiler_thread_id,compiler_thread_handle,compil
= (True,compiler_process_ids,ps)
:: CompilePollCompletedResult = NoFinishedCompiler | UnknownFinishedCompiler | FinishedCompiler !Int !Int
/*
CompilePollCompleted ps
# (ok, exitCode, slot, os)
= AsyncPollCompleted 99
// | trace_n ("CompilePollCompleted ok=" +++ toString ok +++ " slot/r=" +++ toString slot) ok
| ok
= //wait 100
(FinishedCompiler slot exitCode, ps)
// not ok
= (NoFinishedCompiler, ps)
*/
CompilePollCompleted :: !CompilerProcessIds !*env -> (!CompilePollCompletedResult, !*env) | FileEnv env
CompilePollCompleted compiler_process_ids ps
......@@ -328,13 +299,11 @@ get_finished_compiler_id_and_exit_code = code {
CompilePersistent ::
!String !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName
!(List Pathname) !Bool !Bool !Bool !CompilerOptions !Pathname !*CompilingInfo !*env
!(List Pathname) !ProjectCompilerOptions !CompilerOptions !Pathname !*CompilingInfo !*env
-> (!*CompilingInfo,!(!*env, !Pathname, !CompilerMsg))
| FileEnv env
CompilePersistent
cocl` write_module_times errwin typewin compileOrCheckSyntax mdn paths projectHeapProfiling
projectTimeProfiling projectEagerOrDynamic co=:{CompilerOptions | listTypes}
startupdir cstate env
CompilePersistent cocl` write_module_times errwin typewin compileOrCheckSyntax mdn paths project_compiler_options
co=:{CompilerOptions | listTypes} startupdir cstate env
# (cocl_ok,cocl,cocl_dir,cocl_startup,options) = mangleCompiler2 cocl` startupdir // platform dependant mangling...
| not cocl_ok
......@@ -345,8 +314,7 @@ CompilePersistent
errors_file_name = errors_file_path tooltempdir dummy_slot
# cocl_arguments
= options +++ write_module_times_string +++.
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax mdn.mdn_name paths
projectHeapProfiling projectTimeProfiling projectEagerOrDynamic co
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax mdn.mdn_name paths project_compiler_options co
// # cstate = NotCompiling
// # cocl = startupdir+++toString dirseparator +++"cocl.exe";
# (compile_ok,exitcode,(cstate,env)) = compile_with_cache cocl cocl_dir cocl_startup cocl_arguments (cstate,env);
......@@ -361,15 +329,11 @@ where
//-- Generic Compilation stuff...
CompileBuildCommand :: !String !S