Skip to content

Commit

Permalink
use --stacktrace:on,off,noinline to preserve default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Mar 4, 2020
1 parent 2b9dec4 commit 3892088
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import dynlib

template isGnerateNimFrame(options, sym): bool =
optStackTrace in options and
(optStackTraceInline in options or sym.typ.callConv != ccInline)
(optStackTraceNoInline notin options or sym.typ.callConv != ccInline)

when not declared(dynlib.libCandidates):
proc libCandidates(s: string, dest: var seq[string]) =
Expand Down
6 changes: 3 additions & 3 deletions compiler/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ proc testCompileOption*(conf: ConfigRef; switch: string, info: TLineInfo): bool
of "hints": result = contains(conf.options, optHints)
of "threadanalysis": result = contains(conf.globalOptions, optThreadAnalysis)
of "stacktrace": result = contains(conf.options, optStackTrace)
of "stacktraceInline": result = contains(conf.options, optStackTraceInline)
of "stacktraceNoInline": result = contains(conf.options, optStackTraceNoInline)
of "linetrace": result = contains(conf.options, optLineTrace)
of "debugger": result = contains(conf.globalOptions, optCDebug)
of "profiler": result = contains(conf.options, optProfiler)
Expand Down Expand Up @@ -534,8 +534,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
case arg.normalize
of "","on": conf.options.incl optStackTrace
of "off": conf.options.excl optStackTrace
of "inline": conf.options.incl {optStackTrace, optStackTraceInline}
else: localError(conf, info, errExpectedButFound % ["'', 'on', 'off', 'inline'", arg])
of "noinline": conf.options.incl {optStackTrace, optStackTraceNoInline}
else: localError(conf, info, errExpectedButFound % ["'', 'on', 'off', 'noinline'", arg])
of "excessivestacktrace": processOnOffSwitchG(conf, {optExcessiveStackTrace}, arg, pass, info)
of "linetrace": processOnOffSwitch(conf, {optLineTrace}, arg, pass, info)
of "debugger":
Expand Down
2 changes: 1 addition & 1 deletion compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type # please make sure we have under 32 options
optOverflowCheck, optNilCheck, optRefCheck,
optNaNCheck, optInfCheck, optStyleCheck,
optAssert, optLineDir, optWarns, optHints,
optOptimizeSpeed, optOptimizeSize, optStackTrace, optStackTraceInline, # stack tracing support
optOptimizeSpeed, optOptimizeSize, optStackTrace, optStackTraceNoInline, # stack tracing support
optLineTrace, # line tracing support (includes stack tracing)
optByRef, # use pass by ref for objects
# (for interfacing with C)
Expand Down
4 changes: 2 additions & 2 deletions doc/basicopt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Options:
see: "compile time define pragmas")
-u, --undef:SYMBOL undefine a conditional symbol
-f, --forceBuild:on|off force rebuilding of all modules
--stackTrace:on|off|inline turn stack tracing on|off; {.inline.} procs
won't be traceable unless `inline` is used
--stackTrace:on|off|noinline turn stack tracing on|off; {.inline.} procs
won't be traceable with `noinline` option
--lineTrace:on|off turn line tracing on|off
--threads:on|off turn support for multi-threading on|off
-x, --checks:on|off turn all runtime checks on|off
Expand Down

0 comments on commit 3892088

Please sign in to comment.