Commit 1493f119 authored by John van Groningen's avatar John van Groningen

Merge branch 'add-options-to-cpm' into 'master'

Add profiling and rts options to cpm

See merge request !1
parents 437e851a 5bf1a996
......@@ -43,6 +43,14 @@ from PmTypes import ::Pathname,::Output
| DynamicsOff
| GenericFusionOn
| GenericFusionOff
| RTSFlagsOn
| RTSFlagsOff
| StackTraceOn
| StackTraceOff
| TimeProfileOn
| TimeProfileOff
| MemoryProfileOn
| MemoryProfileOff
| DescExLOn
| DescExLOff
| HeapSize !Int
......
......@@ -115,6 +115,10 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world
# (proj_path, proj, ok, world) = openProject pwd pn cleanhome world
| not ok
= world
//Sanity checks on the project file to see if it is tampered with
# appopts = PR_GetApplicationOptions proj
| appopts.stack_traces && not appopts.profiling
= abort "Stack tracing is enabled but time profiling is not\n"
# (console, world) = stdio world
# iniGeneral = initGeneral True compilerOptions cleanhome proj_path proj envs console
# {ls, gst_world} = pinit force {ls=iniGeneral,gst_world=world,gst_continue_or_stop=False}
......@@ -176,6 +180,22 @@ where
= PR_SetApplicationOptions {PR_GetApplicationOptions project & ss = ss} project
set_project_option (Output output) project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & o = output} project
set_project_option RTSFlagsOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & disable_rts_flags=True} project
set_project_option RTSFlagsOn project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & disable_rts_flags=False} project
set_project_option TimeProfileOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & profiling=False, stack_traces=False} project
set_project_option TimeProfileOn project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & profiling=True, stack_traces=False} project
set_project_option StackTraceOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & profiling=False, stack_traces=False} project
set_project_option StackTraceOn project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & profiling=True, stack_traces=True} project
set_project_option MemoryProfileOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & memoryProfiling=False} project
set_project_option MemoryProfileOn project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & memoryProfiling=True} project
set_project_option LinkerGenerateSymbolsOn project
= PR_SetLinkOptions project {PR_GetLinkOptions project & generate_symbol_table=True}
set_project_option LinkerGenerateSymbolsOff project
......@@ -196,14 +216,23 @@ doProjectAction _ _ _ _ world =
, " set option [option] : Set one or more of the following options:"
, " : -generic_fusion,-ngeneric_fusion"
, " : Enable or disable generic fusion"
, " : -strip,-nstrip"
, " : Enable or disable application stripping"
, " : -dynamics,-ndynamics"
, " : Enable or disable dynamics"
, " : -descexl,-descexl"
, " : -descexl,-ndescexl"
, " : Enable or disable descriptor generation and label exporting"
, " : This translates to passing -desc and -exl to cocl"
, " : -rtsopts,-nrtsopts"
, " : Enable or disable the default rts arguments (-h, -s, etc.)"
, " : -b,-nr,-nc,-sc"
, " : Set the output option to BasicValuesOnly, NoReturnType,"
, " : NoConsole or ShowConstructors respectively"
, " : -pt, -npt, -tst, ntst"
, " : Enable or disable time profiling and stack tracing"
, " : Note that these are mutually exclusive and if you select multiple, the last one will take effect"
, " : -mp, -nmp"
, " : Enable or disable memory profiling"
] world
/**
......
......@@ -123,6 +123,30 @@ parse_Project_options ["-nstrip":project_option_args]
parse_Project_options ["-strip":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [LinkerGenerateSymbolsOff:project_options]);
parse_Project_options ["-nrtsopts":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [RTSFlagsOff:project_options]);
parse_Project_options ["-rtsopts":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [RTSFlagsOn:project_options]);
parse_Project_options ["-pt":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [TimeProfileOn:project_options]);
parse_Project_options ["-npt":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [TimeProfileOn:project_options]);
parse_Project_options ["-tst":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [StackTraceOn:project_options]);
parse_Project_options ["-ntst":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [StackTraceOff:project_options]);
parse_Project_options ["-mp":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [MemoryProfileOn:project_options]);
parse_Project_options ["-nmp":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [MemoryProfileOff:project_options]);
parse_Project_options []
= (True,[]);
parse_Project_options _
......
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