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;
......
This diff is collapsed.
......@@ -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 !String !CompileOrCheckSyntax !Pathname !(List Pathname) !Bool !Bool !Bool
!CompilerOptions -> String
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths
projectHeapProfiling projectTimeProfiling projectEagerOrDynamic co
CompileBuildCommand :: !String !String !CompileOrCheckSyntax !Pathname !(List Pathname) !ProjectCompilerOptions !CompilerOptions -> String
CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path paths project_compiler_options co
= MakeCompilerOptionsString
compileOrCheckSyntax
projectHeapProfiling
projectTimeProfiling
projectEagerOrDynamic
project_compiler_options
co
+++ (quoted_string path)
+++ " -P " +++ quoted_string (ConcatenatePath paths)
......@@ -494,24 +458,21 @@ ReadErrorAndWarningMessages file
# (path_error,_,errlist,file3) = ReadErrorAndWarningMessages file2
= (if is_import_error (Patherror path) path_error,True,Strip string:!errlist,file3)
MakeCompilerOptionsString :: !CompileOrCheckSyntax !Bool !Bool !Bool !CompilerOptions -> String
MakeCompilerOptionsString compileOrCheckSyntax projectMemoryProfiling projectTimeProfiling projectEagerOrDynamic
MakeCompilerOptionsString :: !CompileOrCheckSyntax !ProjectCompilerOptions !CompilerOptions -> String
MakeCompilerOptionsString compileOrCheckSyntax {pco_memory_profiling,pco_time_profiling,pco_desc_exl,pco_dynamics,pco_link_dynamic}
{neverMemoryProfile, neverTimeProfile,sa,gw,gc,listTypes,attr,reuseUniqueNodes,fusion}
= options
where
= (add_dynamics_option (add_fusion_option (add_exl_option
(checksyntax +++ timeProfileSwitch +++ memoryProfileSwitch +++ strictness +++ warnings +++ comments +++listtypes+++show_attr+++reuse)
))) +++" "
where
memoryProfileSwitch
| (not neverMemoryProfile && projectMemoryProfiling)
|| projectEagerOrDynamic
| (not neverMemoryProfile && pco_memory_profiling) || pco_desc_exl || pco_link_dynamic
= " -desc"
= ""
timeProfileSwitch
| not neverTimeProfile && projectTimeProfiling
| not neverTimeProfile && pco_time_profiling
= " -pt"
= ""
dynamicLinkSwitch
| projectEagerOrDynamic
= " -exl -dynamics"
= ""
strictness
| sa
= ""
......@@ -544,12 +505,9 @@ where
| reuseUniqueNodes
= " -ou"
= ""
add_fusion_option s = if fusion (s+++" -fusion") s;
options = add_fusion_option (checksyntax +++ timeProfileSwitch +++ memoryProfileSwitch +++ dynamicLinkSwitch
+++ strictness +++ warnings +++ comments +++listtypes+++show_attr+++reuse)
+++" "
add_exl_option s = if (pco_desc_exl || pco_link_dynamic) (s+++" -exl") s
add_fusion_option s = if fusion (s+++" -fusion") s
add_dynamics_option s = if (pco_dynamics || pco_link_dynamic) (s+++" -dynamics") s
/* Generates code for the given file:
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment