preparations of making compiler/msgs.nim free of global variables

This commit is contained in:
Andreas Rumpf 2018-05-17 15:21:22 +02:00
commit bf6c2c5ccf
38 changed files with 179 additions and 183 deletions

View file

@ -40,8 +40,8 @@ type
TGenFlag = enum gfAddrOf, gfFieldAccess
TGenFlags = set[TGenFlag]
proc debugInfo(info: TLineInfo): string =
result = info.toFilename.splitFile.name & ":" & $info.line
proc debugInfo(c: PCtx; info: TLineInfo): string =
result = toFilename(c.config, info).splitFile.name & ":" & $info.line
proc codeListing(c: PCtx, result: var string, start=0; last = -1) =
# first iteration: compute all necessary labels:
@ -85,7 +85,7 @@ proc codeListing(c: PCtx, result: var string, start=0; last = -1) =
else:
result.addf("\t$#\tr$#, $#", ($opc).substr(3), x.regA, x.regBx-wordExcess)
result.add("\t#")
result.add(debugInfo(c.debug[i]))
result.add(debugInfo(c, c.debug[i]))
result.add("\n")
inc i