mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Add new cmdline option -checkaction=<D|C|halt>
This commit is contained in:
parent
d4e680bcdb
commit
2d539fa63d
2 changed files with 17 additions and 1 deletions
|
@ -368,6 +368,18 @@ static cl::opt<MultiSetter, true, FlagParser<bool>>
|
|||
contracts("contracts", cl::ZeroOrMore, cl::location(ContractsSetter),
|
||||
cl::desc("(*) Enable function pre- and post-conditions"));
|
||||
|
||||
static cl::opt<CHECKACTION, true> checkAction(
|
||||
"checkaction", cl::ZeroOrMore, cl::location(global.params.checkAction),
|
||||
cl::desc("Action to take when an assert/boundscheck/final-switch fails"),
|
||||
cl::init(CHECKACTION_D),
|
||||
clEnumValues(
|
||||
clEnumValN(CHECKACTION_D, "D",
|
||||
"Throw an unrecoverable Error (default)"),
|
||||
clEnumValN(CHECKACTION_C, "C",
|
||||
"Call the C runtime library assert failure function"),
|
||||
clEnumValN(CHECKACTION_halt, "halt",
|
||||
"Execute a halt instruction, terminating the program")));
|
||||
|
||||
CHECKENABLE invReleaseMode = CHECKENABLEon;
|
||||
static MultiSetter ReleaseSetter(true, &invReleaseMode,
|
||||
&global.params.useInvariants,
|
||||
|
|
|
@ -163,6 +163,7 @@ Where:\n\
|
|||
-boundscheck=[on|safeonly|off] bounds checks on, in @safe only, or off\n\
|
||||
-c do not link\n\
|
||||
-check=[assert|bounds|in|invariant|out|switch][=[on|off]] Enable or disable specific checks\n\
|
||||
-checkaction=D|C|halt behavior on assert/boundscheck/finalswitch failure\n\
|
||||
-color turn colored console output on\n\
|
||||
-color=[on|off] force colored console output on or off\n\
|
||||
-conf=<filename> use config file at filename\n\
|
||||
|
@ -418,7 +419,10 @@ void translateArgs(size_t originalArgc, char **originalArgv,
|
|||
check(6, "switch", "switch-errors"))) {
|
||||
goto Lerror;
|
||||
}
|
||||
} else if (strncmp(p + 1, "color", 5) == 0) {
|
||||
}
|
||||
/* -checkaction
|
||||
*/
|
||||
else if (strncmp(p + 1, "color", 5) == 0) {
|
||||
bool color = true;
|
||||
// Parse:
|
||||
// -color
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue