diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-05-15 19:54:52 +0300 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-05-15 19:54:52 +0300 |
commit | cfe40a3e6e920ed0c105af0012af739794c10b55 (patch) | |
tree | e823d767192acd7a3988f963633eaaa7a39cb4b3 /compiler/passaux.nim | |
parent | 5d166fcc0ae1ab203f965f0650fd4834542a46f6 (diff) | |
parent | 02f01470ab46067c18535605179b95b143b1e25f (diff) | |
download | Nim-cfe40a3e6e920ed0c105af0012af739794c10b55.tar.gz |
Merge branch 'devel' into yield-in-try
Diffstat (limited to 'compiler/passaux.nim')
-rw-r--r-- | compiler/passaux.nim | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/passaux.nim b/compiler/passaux.nim index 2065d5893..568fb4c23 100644 --- a/compiler/passaux.nim +++ b/compiler/passaux.nim @@ -10,22 +10,26 @@ ## implements some little helper passes import - strutils, ast, astalgo, passes, idents, msgs, options, idgen + strutils, ast, astalgo, passes, idents, msgs, options, idgen, configuration from modulegraphs import ModuleGraph +type + VerboseRef = ref object of TPassContext + config: ConfigRef + proc verboseOpen(graph: ModuleGraph; s: PSym; cache: IdentCache): PPassContext = #MessageOut('compiling ' + s.name.s); - result = nil # we don't need a context - rawMessage(hintProcessing, s.name.s) + result = VerboseRef(config: graph.config) + rawMessage(graph.config, hintProcessing, s.name.s) proc verboseProcess(context: PPassContext, n: PNode): PNode = result = n - if context != nil: internalError("logpass: context is not nil") - if gVerbosity == 3: + let v = VerboseRef(context) + if v.config.verbosity == 3: # system.nim deactivates all hints, for verbosity:3 we want the processing # messages nonetheless, so we activate them again unconditionally: - incl(msgs.gNotes, hintProcessing) - message(n.info, hintProcessing, $idgen.gFrontendId) + incl(v.config.notes, hintProcessing) + message(v.config, n.info, hintProcessing, $idgen.gFrontendId) const verbosePass* = makePass(open = verboseOpen, process = verboseProcess) |