the remaining passes all compile again

This commit is contained in:
Andreas Rumpf 2018-05-13 00:45:52 +02:00
commit 8ca5b71c6a
8 changed files with 129 additions and 117 deletions

View file

@ -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")
let v = VerboseRef(context)
if gVerbosity == 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)