Add new cmdline option -checkaction=<D|C|halt>

This commit is contained in:
Martin Kinkelin 2018-12-21 21:36:42 +01:00
parent d4e680bcdb
commit 2d539fa63d
2 changed files with 17 additions and 1 deletions

View file

@ -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,