summary refs log tree commit diff stats
path: root/compiler/passaux.nim
diff options
context:
space:
mode:
authorkoranza <stflynn@hotmail.com>2018-05-18 16:20:13 -0500
committerGitHub <noreply@github.com>2018-05-18 16:20:13 -0500
commit39988eb1cfae043271376bd21fa301ba2115b59c (patch)
tree661b2410afde62935766ccdf1f1803a1e8e7715f /compiler/passaux.nim
parentb75008292506d49f2641550457354267e11e1116 (diff)
parent06bdf8392bd3e597dbe3ef12c7a819b60e32d7ac (diff)
downloadNim-39988eb1cfae043271376bd21fa301ba2115b59c.tar.gz
Merge pull request #1 from nim-lang/devel
updating my fork with the head repo
Diffstat (limited to 'compiler/passaux.nim')
-rw-r--r--compiler/passaux.nim18
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)