summary refs log tree commit diff stats
path: root/compiler/debugutils.nim
blob: 235c100b37451d85d0dd98c515fcc8429b59c989 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
##[
Utilities to help with debugging nim compiler.

Experimental API, subject to change.
]##

import options

var conf0: ConfigRef

proc onNewConfigRef*(conf: ConfigRef) {.inline.} =
  ## Caches `conf`, which can be retrieved with `getConfigRef`.
  ## This avoids having to forward `conf` all the way down the call chain to
  ## procs that need it during a debugging session.
  conf0 = conf

proc getConfigRef*(): ConfigRef =
  ## nil, if -d:nimDebugUtils wasn't specified
  result = conf0