remove the nilChecks switch; refs #11570

This commit is contained in:
Araq 2020-04-20 11:12:09 +02:00 • committed by Andreas Rumpf
commit 59f1462b95
5 changed files with 5 additions and 9 deletions

View file

@ -406,8 +406,6 @@ proc resetLoc(p: BProc, loc: var TLoc) =
else: else:
linefmt(p, cpsStmts, "$1 = 0;$n", [rdLoc(loc)]) linefmt(p, cpsStmts, "$1 = 0;$n", [rdLoc(loc)])
else: else:
if optNilCheck in p.options:
linefmt(p, cpsStmts, "#chckNil((void*)$1);$n", [addrLoc(p.config, loc)])
if loc.storage != OnStack and containsGcRef: if loc.storage != OnStack and containsGcRef:
linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n", linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n",
[addrLoc(p.config, loc), genTypeInfo(p.module, loc.t, loc.lode.info)]) [addrLoc(p.config, loc), genTypeInfo(p.module, loc.t, loc.lode.info)])

View file

@ -297,7 +297,7 @@ proc testCompileOption*(conf: ConfigRef; switch: string, info: TLineInfo): bool
result = conf.options * {optNaNCheck, optInfCheck} == {optNaNCheck, optInfCheck} result = conf.options * {optNaNCheck, optInfCheck} == {optNaNCheck, optInfCheck}
of "infchecks": result = contains(conf.options, optInfCheck) of "infchecks": result = contains(conf.options, optInfCheck)
of "nanchecks": result = contains(conf.options, optNaNCheck) of "nanchecks": result = contains(conf.options, optNaNCheck)
of "nilchecks": result = contains(conf.options, optNilCheck) of "nilchecks": result = false # not a thing
of "objchecks": result = contains(conf.options, optObjCheck) of "objchecks": result = contains(conf.options, optObjCheck)
of "fieldchecks": result = contains(conf.options, optFieldCheck) of "fieldchecks": result = contains(conf.options, optFieldCheck)
of "rangechecks": result = contains(conf.options, optRangeCheck) of "rangechecks": result = contains(conf.options, optRangeCheck)
@ -594,7 +594,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
processOnOffSwitch(conf, {optNaNCheck, optInfCheck}, arg, pass, info) processOnOffSwitch(conf, {optNaNCheck, optInfCheck}, arg, pass, info)
of "infchecks": processOnOffSwitch(conf, {optInfCheck}, arg, pass, info) of "infchecks": processOnOffSwitch(conf, {optInfCheck}, arg, pass, info)
of "nanchecks": processOnOffSwitch(conf, {optNaNCheck}, arg, pass, info) of "nanchecks": processOnOffSwitch(conf, {optNaNCheck}, arg, pass, info)
of "nilchecks": processOnOffSwitch(conf, {optNilCheck}, arg, pass, info) of "nilchecks": discard "no such thing anymore"
of "objchecks": processOnOffSwitch(conf, {optObjCheck}, arg, pass, info) of "objchecks": processOnOffSwitch(conf, {optObjCheck}, arg, pass, info)
of "fieldchecks": processOnOffSwitch(conf, {optFieldCheck}, arg, pass, info) of "fieldchecks": processOnOffSwitch(conf, {optFieldCheck}, arg, pass, info)
of "rangechecks": processOnOffSwitch(conf, {optRangeCheck}, arg, pass, info) of "rangechecks": processOnOffSwitch(conf, {optRangeCheck}, arg, pass, info)

View file

@ -25,7 +25,7 @@ type # please make sure we have under 32 options
# (improves code efficiency a lot!) # (improves code efficiency a lot!)
TOption* = enum # **keep binary compatible** TOption* = enum # **keep binary compatible**
optNone, optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck, optNone, optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck,
optOverflowCheck, optNilCheck, optRefCheck, optOverflowCheck, optRefCheck,
optNaNCheck, optInfCheck, optStaticBoundsCheck, optStyleCheck, optNaNCheck, optInfCheck, optStaticBoundsCheck, optStyleCheck,
optAssert, optLineDir, optWarns, optHints, optAssert, optLineDir, optWarns, optHints,
optOptimizeSpeed, optOptimizeSize, optOptimizeSpeed, optOptimizeSize,
@ -325,14 +325,14 @@ template depConfigFields*(fn) {.dirty.} =
const oldExperimentalFeatures* = {implicitDeref, dotOperators, callOperator, parallel} const oldExperimentalFeatures* = {implicitDeref, dotOperators, callOperator, parallel}
const const
ChecksOptions* = {optObjCheck, optFieldCheck, optRangeCheck, optNilCheck, ChecksOptions* = {optObjCheck, optFieldCheck, optRangeCheck,
optOverflowCheck, optBoundsCheck, optAssert, optNaNCheck, optInfCheck, optOverflowCheck, optBoundsCheck, optAssert, optNaNCheck, optInfCheck,
optStyleCheck} optStyleCheck}
DefaultOptions* = {optObjCheck, optFieldCheck, optRangeCheck, DefaultOptions* = {optObjCheck, optFieldCheck, optRangeCheck,
optBoundsCheck, optOverflowCheck, optAssert, optWarns, optRefCheck, optBoundsCheck, optOverflowCheck, optAssert, optWarns, optRefCheck,
optHints, optStackTrace, optLineTrace, # consider adding `optStackTraceMsgs` optHints, optStackTrace, optLineTrace, # consider adding `optStackTraceMsgs`
optTrMacros, optNilCheck, optStyleCheck, optSinkInference} optTrMacros, optStyleCheck, optSinkInference}
DefaultGlobalOptions* = {optThreadAnalysis, DefaultGlobalOptions* = {optThreadAnalysis,
optExcessiveStackTrace, optListFullPaths} optExcessiveStackTrace, optListFullPaths}

View file

@ -361,7 +361,6 @@ proc pragmaToOptions(w: TSpecialWord): TOptions {.inline.} =
of wRangeChecks: {optRangeCheck} of wRangeChecks: {optRangeCheck}
of wBoundChecks: {optBoundsCheck} of wBoundChecks: {optBoundsCheck}
of wOverflowChecks: {optOverflowCheck} of wOverflowChecks: {optOverflowCheck}
of wNilChecks: {optNilCheck}
of wFloatChecks: {optNaNCheck, optInfCheck} of wFloatChecks: {optNaNCheck, optInfCheck}
of wNanChecks: {optNaNCheck} of wNanChecks: {optNaNCheck}
of wInfChecks: {optInfCheck} of wInfChecks: {optInfCheck}

View file

@ -24,7 +24,6 @@ Runtime checks (see -x):
--floatChecks:on|off turn all floating point (NaN/Inf) checks on|off --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off
--nanChecks:on|off turn NaN checks on|off --nanChecks:on|off turn NaN checks on|off
--infChecks:on|off turn Inf checks on|off --infChecks:on|off turn Inf checks on|off
--nilChecks:on|off turn nil checks on|off
--refChecks:on|off turn ref checks on|off (only for --newruntime) --refChecks:on|off turn ref checks on|off (only for --newruntime)
Advanced options: Advanced options: